提交 62490330 编写于 作者: J Jan Kara

fuse: Propagate dentry down to inode_change_ok()

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: NMiklos Szeredi <mszeredi@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 fd5472ed
...@@ -1591,9 +1591,10 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff) ...@@ -1591,9 +1591,10 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff)
* vmtruncate() doesn't allow for this case, so do the rlimit checking * vmtruncate() doesn't allow for this case, so do the rlimit checking
* and the actual truncation by hand. * 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 file *file)
{ {
struct inode *inode = d_inode(dentry);
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode); struct fuse_inode *fi = get_fuse_inode(inode);
FUSE_ARGS(args); FUSE_ARGS(args);
...@@ -1707,9 +1708,9 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) ...@@ -1707,9 +1708,9 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
return -EACCES; return -EACCES;
if (attr->ia_valid & ATTR_FILE) 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 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, static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry,
......
...@@ -2841,7 +2841,7 @@ static void fuse_do_truncate(struct file *file) ...@@ -2841,7 +2841,7 @@ static void fuse_do_truncate(struct file *file)
attr.ia_file = file; attr.ia_file = file;
attr.ia_valid |= ATTR_FILE; attr.ia_valid |= ATTR_FILE;
fuse_do_setattr(inode, &attr, file); fuse_do_setattr(file_dentry(file), &attr, file);
} }
static inline loff_t fuse_round_up(loff_t off) static inline loff_t fuse_round_up(loff_t off)
......
...@@ -958,7 +958,7 @@ bool fuse_write_update_size(struct inode *inode, loff_t pos); ...@@ -958,7 +958,7 @@ bool fuse_write_update_size(struct inode *inode, loff_t pos);
int fuse_flush_times(struct inode *inode, struct fuse_file *ff); int fuse_flush_times(struct inode *inode, struct fuse_file *ff);
int fuse_write_inode(struct inode *inode, struct writeback_control *wbc); int fuse_write_inode(struct inode *inode, struct writeback_control *wbc);
int fuse_do_setattr(struct inode *inode, struct iattr *attr, int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
struct file *file); struct file *file);
void fuse_set_initialized(struct fuse_conn *fc); void fuse_set_initialized(struct fuse_conn *fc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册