diff options
-rw-r--r-- | fs/ext4/move_extent.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 5332fd4c4028..25b6b1457360 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -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) |