Skip to contentSkip to conversation

fs: unexport ioctl_getflags

PATCH Applied Christoph Hellwig 5 participants 11 messages Nov 18, 2025 – Nov 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: unexport ioctl_getflags

No modular users, nor should there be any for a dispatcher like this.

---
 fs/file_attr.c | 1 -
 1 file changed, 1 deletion(-)
fs/file_attr.c +0 -1
index 1dcec88c0680..63d62742fbb1 100644
@@ -316,7 +316,6 @@ int ioctl_getflags(struct file *file, unsigned int __user *argp)
 		err = put_user(fa.flags, argp);
 	return err;
 }
-EXPORT_SYMBOL(ioctl_getflags);
 
 int ioctl_setflags(struct file *file, unsigned int __user *argp)
 {
Signature · 1 line
2.47.3
#2 lore raw
In reply to Christoph Hellwig
Quoted 1 line · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

Does the same logic apply to the EXPORT_SYMBOLs of ioctl_setflags / ioctl_fs[gs]etxattr?

--D

Quoted 21 lines
---
 fs/file_attr.c | 1 -
 1 file changed, 1 deletion(-)
fs/file_attr.c +0 -1
index 1dcec88c0680..63d62742fbb1 100644
@@ -316,7 +316,6 @@ int ioctl_getflags(struct file *file, unsigned int __user *argp)
 		err = put_user(fa.flags, argp);
 	return err;
 }
-EXPORT_SYMBOL(ioctl_getflags);
 
 int ioctl_setflags(struct file *file, unsigned int __user *argp)
 {
Signature · 1 line
2.47.3
#3 lore raw
Quoted 5 lines · Darrick J. Wong
Quoted 1 line · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

Does the same logic apply to the EXPORT_SYMBOLs of ioctl_setflags / ioctl_fs[gs]etxattr?

Yes.

maintainer
#4 lore raw
In reply to Christoph Hellwig
Quoted 1 line · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

... and AFAICS there never had been any, so it shouldn't have been exported in the first place.

#5 lore raw
Quoted 5 lines · Al Viro
Quoted 1 line · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

... and AFAICS there never had been any, so it shouldn't have been exported in the first place.

Good question. It looks like Andrey added them when moving to the code to a new file despite that commit claiming to be pure refactoring.

maintainer Applied
#6 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

Applied to the vfs-6.19.misc branch of the vfs/vfs.git tree. Patches in the vfs-6.19.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.misc

[1/1] fs: unexport ioctl_getflags

      https://git.kernel.org/vfs/vfs/c/87f58c6cc372
#7 lore raw
Quoted 4 lines · Christian Brauner
Quoted 3 lines · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

I was going to send a patch doing all the exports in file_attr.c in one go. I can do that incrementally, but I think it would be a tad cleaner.

#8 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 4 lines · Christian Brauner
Quoted 3 lines · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

I was going to send a patch doing all the exports in file_attr.c in one go. I can do that incrementally, but I think it would be a tad cleaner.

Sure, send it it one patch. I can update.

#9 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

---

Ideally we'd be able to catch unnecessary exports automatically. Which would also be nice because it would mean that we could enforce automatic removal of unused exports. I'm pretty sure we have a bunch of them without realizing it.

#10 lore raw
Quoted 10 lines · Christian Brauner
Quoted 4 lines · Christoph Hellwig

No modular users, nor should there be any for a dispatcher like this.

---

Ideally we'd be able to catch unnecessary exports automatically. Which would also be nice because it would mean that we could enforce automatic removal of unused exports. I'm pretty sure we have a bunch of them without realizing it.

The problem with that is that it is so configuration dependent.

Also there are occasional cases where we add exports in one merge window for the users to appear in the next one to reduce cross-subsystem dependencies, so we'd nee to do this manually.

Maybe just having CONFIG_TRIM_UNUSED_KSYMS outout the unused symbols in a log file and manually looking over that for various allmodconfigs might be a good start.