Commit 2f1936b87783a3a56c9441b27b9ba7a747f11e8e
Committed by
Al Viro
1 parent
c82e42da8a
Exists in
master
and in
20 other branches
[patch 3/5] vfs: change remove_suid() to file_remove_suid()
All calls to remove_suid() are made with a file pointer, because (similarly to file_update_time) it is called when the file is written. Clean up callers by passing in a file instead of a dentry. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Showing 7 changed files with 11 additions and 10 deletions Side-by-side Diff
fs/fuse/file.c
fs/ntfs/file.c
fs/splice.c
... | ... | @@ -772,7 +772,7 @@ |
772 | 772 | ssize_t ret; |
773 | 773 | int err; |
774 | 774 | |
775 | - err = remove_suid(out->f_path.dentry); | |
775 | + err = file_remove_suid(out); | |
776 | 776 | if (unlikely(err)) |
777 | 777 | return err; |
778 | 778 | |
... | ... | @@ -830,7 +830,7 @@ |
830 | 830 | ssize_t ret; |
831 | 831 | |
832 | 832 | inode_double_lock(inode, pipe->inode); |
833 | - ret = remove_suid(out->f_path.dentry); | |
833 | + ret = file_remove_suid(out); | |
834 | 834 | if (likely(!ret)) |
835 | 835 | ret = __splice_from_pipe(pipe, &sd, pipe_to_file); |
836 | 836 | inode_double_unlock(inode, pipe->inode); |
fs/xfs/linux-2.6/xfs_lrw.c
include/linux/fs.h
... | ... | @@ -1834,7 +1834,7 @@ |
1834 | 1834 | extern void destroy_inode(struct inode *); |
1835 | 1835 | extern struct inode *new_inode(struct super_block *); |
1836 | 1836 | extern int should_remove_suid(struct dentry *); |
1837 | -extern int remove_suid(struct dentry *); | |
1837 | +extern int file_remove_suid(struct file *); | |
1838 | 1838 | |
1839 | 1839 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
1840 | 1840 | extern void remove_inode_hash(struct inode *); |
mm/filemap.c
... | ... | @@ -1758,8 +1758,9 @@ |
1758 | 1758 | return notify_change(dentry, &newattrs); |
1759 | 1759 | } |
1760 | 1760 | |
1761 | -int remove_suid(struct dentry *dentry) | |
1761 | +int file_remove_suid(struct file *file) | |
1762 | 1762 | { |
1763 | + struct dentry *dentry = file->f_path.dentry; | |
1763 | 1764 | int killsuid = should_remove_suid(dentry); |
1764 | 1765 | int killpriv = security_inode_need_killpriv(dentry); |
1765 | 1766 | int error = 0; |
... | ... | @@ -1773,7 +1774,7 @@ |
1773 | 1774 | |
1774 | 1775 | return error; |
1775 | 1776 | } |
1776 | -EXPORT_SYMBOL(remove_suid); | |
1777 | +EXPORT_SYMBOL(file_remove_suid); | |
1777 | 1778 | |
1778 | 1779 | static size_t __iovec_copy_from_user_inatomic(char *vaddr, |
1779 | 1780 | const struct iovec *iov, size_t base, size_t bytes) |
... | ... | @@ -2529,7 +2530,7 @@ |
2529 | 2530 | if (count == 0) |
2530 | 2531 | goto out; |
2531 | 2532 | |
2532 | - err = remove_suid(file->f_path.dentry); | |
2533 | + err = file_remove_suid(file); | |
2533 | 2534 | if (err) |
2534 | 2535 | goto out; |
2535 | 2536 |