aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
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/reiserfs
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/reiserfs')
-rw-r--r--fs/reiserfs/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 2b8dc5c22867..46ba1cfc2df3 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -3084,6 +3084,10 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3084 int depth; 3084 int depth;
3085 int error; 3085 int error;
3086 3086
3087 error = inode_change_ok(inode, attr);
3088 if (error)
3089 return error;
3090
3087 /* must be turned off for recursive notify_change calls */ 3091 /* must be turned off for recursive notify_change calls */
3088 ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); 3092 ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID);
3089 3093
@@ -3133,10 +3137,6 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3133 goto out; 3137 goto out;
3134 } 3138 }
3135 3139
3136 error = inode_change_ok(inode, attr);
3137 if (error)
3138 goto out;
3139
3140 if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || 3140 if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
3141 (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { 3141 (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
3142 struct reiserfs_transaction_handle th; 3142 struct reiserfs_transaction_handle th;