patch-2.6.6-vs1.9.1
[linux-2.6.git] / fs / ext3 / ioctl.c
index 82c325f..21080fb 100644 (file)
@@ -58,7 +58,9 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                 *
                 * This test looks nicer. Thanks to Pauline Middelink
                 */
-               if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
+               if ((oldflags & EXT3_IMMUTABLE_FL) ||
+                       ((flags ^ oldflags) &
+                       (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL))) {
                        if (!capable(CAP_LINUX_IMMUTABLE))
                                return -EPERM;
                }