Skip to contentSkip to conversation

fs: mark file_remove_privs_flags static

PATCH Applied Christoph Hellwig 4 participants 4 messages Jul 24, 2025 – Jul 31, 2025 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: mark file_remove_privs_flags static

file_remove_privs_flags is only used inside of inode.c, mark it static.

---
 fs/inode.c         | 3 +--
 include/linux/fs.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
fs/inode.c +1 -2
index 99318b157a9a..14abe12865e3 100644
@@ -2190,7 +2190,7 @@ static int __remove_privs(struct mnt_idmap *idmap,
 	return notify_change(idmap, dentry, &newattrs, NULL);
 }
 
-int file_remove_privs_flags(struct file *file, unsigned int flags)
+static int file_remove_privs_flags(struct file *file, unsigned int flags)
 {
 	struct dentry *dentry = file_dentry(file);
 	struct inode *inode = file_inode(file);
@@ -2215,7 +2215,6 @@ int file_remove_privs_flags(struct file *file, unsigned int flags)
 		inode_has_no_xattr(inode);
 	return error;
 }
-EXPORT_SYMBOL_GPL(file_remove_privs_flags);
 
 /**
  * file_remove_privs - remove special file privileges (suid, capabilities)
include/linux/fs.h +0 -1
index 040c0036320f..b57e4c3996a8 100644
@@ -3366,7 +3366,6 @@ static inline struct inode *new_inode_pseudo(struct super_block *sb)
 extern struct inode *new_inode(struct super_block *sb);
 extern void free_inode_nonrcu(struct inode *inode);
 extern int setattr_should_drop_suidgid(struct mnt_idmap *, struct inode *);
-extern int file_remove_privs_flags(struct file *file, unsigned int flags);
 extern int file_remove_privs(struct file *);
 int setattr_should_drop_sgid(struct mnt_idmap *idmap,
 			     const struct inode *inode);
Signature · 1 line
2.47.2
maintainer
#1 lore raw
Quoted 1 line · Christoph Hellwig

file_remove_privs_flags is only used inside of inode.c, mark it static.

That's close being a revert of 66a67c860cce "fs: file_remove_privs_flags()"; I've no objections per se, but at least a Cc to Kent and summary of the history in commit message would be useful.

AFAICS, the history is more or less "the only in-tree user got reverted in August 2024 and hadn't come back since then; its removal did not touch the export", but I've no idea if it has successors yet to be merged back into the tree.

Again, I've no problem with making the damn thing static, but some context would be useful.

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

file_remove_privs_flags is only used inside of inode.c, mark it static.

That's close being a revert of 66a67c860cce "fs: file_remove_privs_flags()"; I've no objections per se, but at least a Cc to Kent and summary of the history in commit message would be useful.

Quoted 7 lines

AFAICS, the history is more or less "the only in-tree user got reverted in August 2024 and hadn't come back since then; its removal did not touch the export", but I've no idea if it has successors yet to be merged back into the tree.

Again, I've no problem with making the damn thing static, but some context would be useful.

Oh, that...

That was for a buffered write path that didn't need the inode lock (if we're not extending we should be able to just lock all the folios - right?) - which got reverted due to some absolutely nutty page cache corruption that I was never able to track down.

We still want that, but I won't get back to it in less than a year, bcachefs is currently in hard freeze and I've been snapping at people who come to me with feature requests...

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

file_remove_privs_flags is only used inside of inode.c, mark it static.

Applied to the vfs-6.18.misc branch of the vfs/vfs.git tree. Patches in the vfs-6.18.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.18.misc

[1/1] fs: mark file_remove_privs_flags static

      https://git.kernel.org/vfs/vfs/c/0fdf709a849f