Remove locking of moved directory in ext4_rename2(). We will take care
of it in VFS instead. This effectively reverts commit 0813299c586b
("ext4: Fix possible corruption when moving a directory") and followup
fixes.

CC: Ted Tso <ty...@mit.edu>
CC: sta...@vger.kernel.org
Signed-off-by: Jan Kara <j...@suse.cz>
---
 fs/ext4/namei.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 45b579805c95..0caf6c730ce3 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -3834,19 +3834,10 @@ static int ext4_rename(struct mnt_idmap *idmap, struct 
inode *old_dir,
                        return retval;
        }
 
-       /*
-        * We need to protect against old.inode directory getting converted
-        * from inline directory format into a normal one.
-        */
-       if (S_ISDIR(old.inode->i_mode))
-               inode_lock_nested(old.inode, I_MUTEX_NONDIR2);
-
        old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de,
                                 &old.inlined);
-       if (IS_ERR(old.bh)) {
-               retval = PTR_ERR(old.bh);
-               goto unlock_moved_dir;
-       }
+       if (IS_ERR(old.bh))
+               return PTR_ERR(old.bh);
 
        /*
         *  Check for inode number is _not_ due to possible IO errors.
@@ -4043,10 +4034,6 @@ static int ext4_rename(struct mnt_idmap *idmap, struct 
inode *old_dir,
        brelse(old.bh);
        brelse(new.bh);
 
-unlock_moved_dir:
-       if (S_ISDIR(old.inode->i_mode))
-               inode_unlock(old.inode);
-
        return retval;
 }
 
-- 
2.35.3



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to