diff options
author | Jan Kara <jack@suse.cz> | 2016-05-26 17:12:41 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-02-23 03:53:52 +0000 |
commit | 2dd45cd109b0a950f1022f8fbddae2383b6015a0 (patch) | |
tree | 8ea1fa0dea31f91bc3d78bc9cc961d33148640e8 /fs/fuse/dir.c | |
parent | e043e711a028a94906d2e28efd19a364842ea61b (diff) |
fuse: Propagate dentry down to inode_change_ok()
commit 62490330769c1ce5dcba3f1f3e8f4005e9b797e6 upstream.
To avoid clearing of capabilities or security related extended
attributes too early, inode_change_ok() will need to take dentry instead
of inode. Propagate it down to fuse_do_setattr().
Acked-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
[bwh: Backported to 3.16: open-code file_dentry()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 0c6048247a34..35a5ffd1aa80 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1704,9 +1704,10 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff) * vmtruncate() doesn't allow for this case, so do the rlimit checking * and the actual truncation by hand. */ -int fuse_do_setattr(struct inode *inode, struct iattr *attr, +int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, struct file *file) { + struct inode *inode = d_inode(dentry); struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); struct fuse_req *req; @@ -1826,9 +1827,9 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) return -EACCES; if (attr->ia_valid & ATTR_FILE) - return fuse_do_setattr(inode, attr, attr->ia_file); + return fuse_do_setattr(entry, attr, attr->ia_file); else - return fuse_do_setattr(inode, attr, NULL); + return fuse_do_setattr(entry, attr, NULL); } static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry, |