]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/ubifs/ioctl.c
Merge branch 'pm-devfreq'
[linux.git] / fs / ubifs / ioctl.c
index 4f1a397fda6904e1923b21f6436c74d01a93f1dc..034ad14710d14a395ab818389be4cbe5177cec9e 100644 (file)
@@ -107,18 +107,11 @@ static int setflags(struct inode *inode, int flags)
        if (err)
                return err;
 
-       /*
-        * The IMMUTABLE and APPEND_ONLY flags can only be changed by
-        * the relevant capability.
-        */
        mutex_lock(&ui->ui_mutex);
        oldflags = ubifs2ioctl(ui->flags);
-       if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) {
-               if (!capable(CAP_LINUX_IMMUTABLE)) {
-                       err = -EPERM;
-                       goto out_unlock;
-               }
-       }
+       err = vfs_ioc_setflags_prepare(inode, oldflags, flags);
+       if (err)
+               goto out_unlock;
 
        ui->flags = ioctl2ubifs(flags);
        ubifs_set_inode_flags(inode);