]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ext4/move_extent.c
ext4: Make sure the MOVE_EXT ioctl can't overwrite append-only files
[net-next-2.6.git] / fs / ext4 / move_extent.c
index 3a6c92ac131c449b61f58194087fe376dbd0f32f..52abfa12762a6020c20ee9b62f62227fd16c078f 100644 (file)
@@ -960,6 +960,9 @@ mext_check_arguments(struct inode *orig_inode,
                return -EINVAL;
        }
 
+       if (IS_IMMUTABLE(donor_inode) || IS_APPEND(donor_inode))
+               return -EPERM;
+
        /* Ext4 move extent does not support swapfile */
        if (IS_SWAPFILE(orig_inode) || IS_SWAPFILE(donor_inode)) {
                ext4_debug("ext4 move extent: The argument files should "