]> Pileus Git - ~andy/linux/blobdiff - fs/ext4/move_extent.c
Merge branch 'topic/isa' into topic/misc
[~andy/linux] / fs / ext4 / move_extent.c
index 3a6c92ac131c449b61f58194087fe376dbd0f32f..5f1ed9fc913c207d5bcc99f3ce63413a4a931ad8 100644 (file)
@@ -148,17 +148,17 @@ mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
  */
 static int
 mext_check_null_inode(struct inode *inode1, struct inode *inode2,
-               const char *function)
+                     const char *function, unsigned int line)
 {
        int ret = 0;
 
        if (inode1 == NULL) {
-               __ext4_error(inode2->i_sb, function,
+               __ext4_error(inode2->i_sb, function, line,
                        "Both inodes should not be NULL: "
                        "inode1 NULL inode2 %lu", inode2->i_ino);
                ret = -EIO;
        } else if (inode2 == NULL) {
-               __ext4_error(inode1->i_sb, function,
+               __ext4_error(inode1->i_sb, function, line,
                        "Both inodes should not be NULL: "
                        "inode1 %lu inode2 NULL", inode1->i_ino);
                ret = -EIO;
@@ -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 "
@@ -1081,7 +1084,7 @@ mext_inode_double_lock(struct inode *inode1, struct inode *inode2)
 
        BUG_ON(inode1 == NULL && inode2 == NULL);
 
-       ret = mext_check_null_inode(inode1, inode2, __func__);
+       ret = mext_check_null_inode(inode1, inode2, __func__, __LINE__);
        if (ret < 0)
                goto out;
 
@@ -1118,7 +1121,7 @@ mext_inode_double_unlock(struct inode *inode1, struct inode *inode2)
 
        BUG_ON(inode1 == NULL && inode2 == NULL);
 
-       ret = mext_check_null_inode(inode1, inode2, __func__);
+       ret = mext_check_null_inode(inode1, inode2, __func__, __LINE__);
        if (ret < 0)
                goto out;