This is a note to let you know that I've just added the patch titled ext4: fix possible double unlock when moving a directory to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-fix-possible-double-unlock-when-moving-a-directory.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 70e42feab2e20618ddd0cbfc4ab4b08628236ecd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o <tytso@xxxxxxx> Date: Fri, 17 Mar 2023 21:53:52 -0400 Subject: ext4: fix possible double unlock when moving a directory From: Theodore Ts'o <tytso@xxxxxxx> commit 70e42feab2e20618ddd0cbfc4ab4b08628236ecd upstream. Fixes: 0813299c586b ("ext4: Fix possible corruption when moving a directory") Link: https://lore.kernel.org/r/5efbe1b9-ad8b-4a4f-b422-24824d2b775c@kili.mountain Reported-by: Dan Carpenter <error27@xxxxxxxxx> Reported-by: syzbot+0c73d1d8b952c5f3d714@xxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/namei.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -3934,10 +3934,8 @@ static int ext4_rename(struct inode *old goto end_rename; } retval = ext4_rename_dir_prepare(handle, &old); - if (retval) { - inode_unlock(old.inode); + if (retval) goto end_rename; - } } /* * If we're renaming a file within an inline_data dir and adding or Patches currently in stable-queue which might be from tytso@xxxxxxx are queue-5.10/ext4-fail-ext4_iget-if-special-inode-unallocated.patch queue-5.10/ext4-fix-possible-double-unlock-when-moving-a-directory.patch queue-5.10/ext4-fix-task-hung-in-ext4_xattr_delete_inode.patch