ext4: Remove ext4 locking of moved directory
commit3658840cd3upstream. Remove locking of moved directory in ext4_rename2(). We will take care of it in VFS instead. This effectively reverts commit0813299c58("ext4: Fix possible corruption when moving a directory") and followup fixes. CC: Ted Tso <tytso@mit.edu> CC: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20230601105830.13168-1-jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e7d18a52c
commit
2b563acd2d
+2
-15
@@ -3863,19 +3863,10 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||||||
return retval;
|
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.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de,
|
||||||
&old.inlined);
|
&old.inlined);
|
||||||
if (IS_ERR(old.bh)) {
|
if (IS_ERR(old.bh))
|
||||||
retval = PTR_ERR(old.bh);
|
return PTR_ERR(old.bh);
|
||||||
goto unlock_moved_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for inode number is _not_ due to possible IO errors.
|
* Check for inode number is _not_ due to possible IO errors.
|
||||||
@@ -4065,10 +4056,6 @@ release_bh:
|
|||||||
brelse(old.bh);
|
brelse(old.bh);
|
||||||
brelse(new.bh);
|
brelse(new.bh);
|
||||||
|
|
||||||
unlock_moved_dir:
|
|
||||||
if (S_ISDIR(old.inode->i_mode))
|
|
||||||
inode_unlock(old.inode);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user