]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ext4/ioctl.c
Forbid user to change file flags on quota files
[net-next-2.6.git] / fs / ext4 / ioctl.c
index c04c7ccba9e3f140ed5243a6ccdcc58d6afcaa15..e7f894bdb4202359974088ba5c1f14585a43fc03 100644 (file)
@@ -51,6 +51,11 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                        flags &= ~EXT4_DIRSYNC_FL;
 
                mutex_lock(&inode->i_mutex);
+               /* Is it quota file? Do not allow user to mess with it */
+               if (IS_NOQUOTA(inode)) {
+                       mutex_unlock(&inode->i_mutex);
+                       return -EPERM;
+               }
                oldflags = ei->i_flags;
 
                /* The JOURNAL_DATA flag is modifiable only by root */