aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/ioctl.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2007-11-14 19:58:56 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 21:45:38 -0500
commite47776a0a41a14a5634633c96e590827f552c4b5 (patch)
tree44d5168b83fb1d8d72668728c690116d34f6711f /fs/reiserfs/ioctl.c
parent28822f22e18fc3c422f64b5bf0bb1e6c306af634 (diff)
Forbid user to change file flags on quota files
Forbid user from changing file flags on quota files. User has no bussiness in playing with these flags when quota is on. Furthermore there is a remote possibility of deadlock due to a lock inversion between quota file's i_mutex and transaction's start (i_mutex for quota file is locked only when trasaction is started in quota operations) in ext3 and ext4. Signed-off-by: Jan Kara <jack@suse.cz> Cc: LIOU Payphone <lioupayphone@gmail.com> Cc: <linux-ext4@vger.kernel.org> Acked-by: Dave Kleikamp <shaggy@austin.ibm.com> Cc: <reiserfs-dev@namesys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/ioctl.c')
-rw-r--r--fs/reiserfs/ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index c438a8f83f26..e0f0f098a523 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -57,6 +57,9 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
57 if (get_user(flags, (int __user *)arg)) 57 if (get_user(flags, (int __user *)arg))
58 return -EFAULT; 58 return -EFAULT;
59 59
60 /* Is it quota file? Do not allow user to mess with it. */
61 if (IS_NOQUOTA(inode))
62 return -EPERM;
60 if (((flags ^ REISERFS_I(inode)-> 63 if (((flags ^ REISERFS_I(inode)->
61 i_attrs) & (REISERFS_IMMUTABLE_FL | 64 i_attrs) & (REISERFS_IMMUTABLE_FL |
62 REISERFS_APPEND_FL)) 65 REISERFS_APPEND_FL))