aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 05:30:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:38 -0400
commitdb78b877f7744bec4a9d9f9e7d10da3931d7cd39 (patch)
treefd9ee2fbe0998218b6d90322f85b285887e6fe9d /fs/logfs
parent1025774ce411f2bd4b059ad7b53f0003569b74fa (diff)
always call inode_change_ok early in ->setattr
Make sure we call inode_change_ok before doing any changes in ->setattr, and make sure to call it even if our fs wants to ignore normal UNIX permissions, but use the ATTR_FORCE to skip those. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/logfs')
-rw-r--r--fs/logfs/file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/logfs/file.c b/fs/logfs/file.c
index 23b4d03bbd26..4dd0f7c06e39 100644
--- a/fs/logfs/file.c
+++ b/fs/logfs/file.c
@@ -232,16 +232,16 @@ static int logfs_setattr(struct dentry *dentry, struct iattr *attr)
232 struct inode *inode = dentry->d_inode; 232 struct inode *inode = dentry->d_inode;
233 int err = 0; 233 int err = 0;
234 234
235 err = inode_change_ok(inode, attr);
236 if (err)
237 return err;
238
235 if (attr->ia_valid & ATTR_SIZE) { 239 if (attr->ia_valid & ATTR_SIZE) {
236 err = logfs_truncate(inode, attr->ia_size); 240 err = logfs_truncate(inode, attr->ia_size);
237 if (err) 241 if (err)
238 return err; 242 return err;
239 } 243 }
240 244
241 err = inode_change_ok(inode, attr);
242 if (err)
243 return err;
244
245 setattr_copy(inode, attr); 245 setattr_copy(inode, attr);
246 mark_inode_dirty(inode); 246 mark_inode_dirty(inode);
247 return 0; 247 return 0;