This is a note to let you know that I've just added the patch titled Revert "udf: Protect rename against modification of moved directory" to the 6.4-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: revert-udf-protect-rename-against-modification-of-moved-directory.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7517ce5dc4d6963ef9ace2acb3f081ef8cd8a1e3 Mon Sep 17 00:00:00 2001 From: Jan Kara <jack@xxxxxxx> Date: Thu, 1 Jun 2023 12:58:22 +0200 Subject: Revert "udf: Protect rename against modification of moved directory" From: Jan Kara <jack@xxxxxxx> commit 7517ce5dc4d6963ef9ace2acb3f081ef8cd8a1e3 upstream. This reverts commit f950fd0529130a617b3da526da9fb6a896ce87c2. The locking is going to be provided by vfs_rename() in the following patches. CC: stable@xxxxxxxxxxxxxxx Signed-off-by: Jan Kara <jack@xxxxxxx> Message-Id: <20230601105830.13168-2-jack@xxxxxxx> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/udf/namei.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -793,11 +793,6 @@ static int udf_rename(struct mnt_idmap * if (!empty_dir(new_inode)) goto out_oiter; } - /* - * We need to protect against old_inode getting converted from - * ICB to normal directory. - */ - inode_lock_nested(old_inode, I_MUTEX_NONDIR2); retval = udf_fiiter_find_entry(old_inode, &dotdot_name, &diriter); if (retval == -ENOENT) { @@ -806,10 +801,8 @@ static int udf_rename(struct mnt_idmap * old_inode->i_ino); retval = -EFSCORRUPTED; } - if (retval) { - inode_unlock(old_inode); + if (retval) goto out_oiter; - } has_diriter = true; tloc = lelb_to_cpu(diriter.fi.icb.extLocation); if (udf_get_lb_pblock(old_inode->i_sb, &tloc, 0) != @@ -889,7 +882,6 @@ static int udf_rename(struct mnt_idmap * udf_dir_entry_len(&diriter.fi)); udf_fiiter_write_fi(&diriter, NULL); udf_fiiter_release(&diriter); - inode_unlock(old_inode); inode_dec_link_count(old_dir); if (new_inode) @@ -901,10 +893,8 @@ static int udf_rename(struct mnt_idmap * } return 0; out_oiter: - if (has_diriter) { + if (has_diriter) udf_fiiter_release(&diriter); - inode_unlock(old_inode); - } udf_fiiter_release(&oiter); return retval; Patches currently in stable-queue which might be from jack@xxxxxxx are queue-6.4/fs-establish-locking-order-for-unrelated-directories.patch queue-6.4/revert-f2fs-fix-potential-corruption-when-moving-a-directory.patch queue-6.4/ext4-remove-ext4-locking-of-moved-directory.patch queue-6.4/writeback-account-the-number-of-pages-written-back.patch queue-6.4/fanotify-disallow-mount-sb-marks-on-kernel-internal-.patch queue-6.4/fs-lock-moved-directories.patch queue-6.4/blk-mq-fix-potential-io-hang-by-wrong-wake_batch.patch queue-6.4/revert-udf-protect-rename-against-modification-of-moved-directory.patch