diff options
Diffstat (limited to 'fs/ext4/move_extent.c')
-rw-r--r-- | fs/ext4/move_extent.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index c07a2915e40b..25b6b1457360 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -322,7 +322,7 @@ mext_insert_across_blocks(handle_t *handle, struct inode *orig_inode, | |||
322 | goto out; | 322 | goto out; |
323 | 323 | ||
324 | if (ext4_ext_insert_extent(handle, orig_inode, | 324 | if (ext4_ext_insert_extent(handle, orig_inode, |
325 | orig_path, new_ext)) | 325 | orig_path, new_ext, 0)) |
326 | goto out; | 326 | goto out; |
327 | } | 327 | } |
328 | 328 | ||
@@ -333,7 +333,7 @@ mext_insert_across_blocks(handle_t *handle, struct inode *orig_inode, | |||
333 | goto out; | 333 | goto out; |
334 | 334 | ||
335 | if (ext4_ext_insert_extent(handle, orig_inode, | 335 | if (ext4_ext_insert_extent(handle, orig_inode, |
336 | orig_path, end_ext)) | 336 | orig_path, end_ext, 0)) |
337 | goto out; | 337 | goto out; |
338 | } | 338 | } |
339 | out: | 339 | out: |
@@ -1001,14 +1001,6 @@ mext_check_arguments(struct inode *orig_inode, | |||
1001 | return -EINVAL; | 1001 | return -EINVAL; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | /* orig and donor should be different file */ | ||
1005 | if (orig_inode->i_ino == donor_inode->i_ino) { | ||
1006 | ext4_debug("ext4 move extent: The argument files should not " | ||
1007 | "be same file [ino:orig %lu, donor %lu]\n", | ||
1008 | orig_inode->i_ino, donor_inode->i_ino); | ||
1009 | return -EINVAL; | ||
1010 | } | ||
1011 | |||
1012 | /* Ext4 move extent supports only extent based file */ | 1004 | /* Ext4 move extent supports only extent based file */ |
1013 | if (!(EXT4_I(orig_inode)->i_flags & EXT4_EXTENTS_FL)) { | 1005 | if (!(EXT4_I(orig_inode)->i_flags & EXT4_EXTENTS_FL)) { |
1014 | ext4_debug("ext4 move extent: orig file is not extents " | 1006 | ext4_debug("ext4 move extent: orig file is not extents " |
@@ -1232,6 +1224,14 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, | |||
1232 | int block_len_in_page; | 1224 | int block_len_in_page; |
1233 | int uninit; | 1225 | int uninit; |
1234 | 1226 | ||
1227 | /* orig and donor should be different file */ | ||
1228 | if (orig_inode->i_ino == donor_inode->i_ino) { | ||
1229 | ext4_debug("ext4 move extent: The argument files should not " | ||
1230 | "be same file [ino:orig %lu, donor %lu]\n", | ||
1231 | orig_inode->i_ino, donor_inode->i_ino); | ||
1232 | return -EINVAL; | ||
1233 | } | ||
1234 | |||
1235 | /* protect orig and donor against a truncate */ | 1235 | /* protect orig and donor against a truncate */ |
1236 | ret1 = mext_inode_double_lock(orig_inode, donor_inode); | 1236 | ret1 = mext_inode_double_lock(orig_inode, donor_inode); |
1237 | if (ret1 < 0) | 1237 | if (ret1 < 0) |