Skip to content

Commit 7517ce5

Browse files
jankarabrauner
authored andcommitted
Revert "udf: Protect rename against modification of moved directory"
This reverts commit f950fd0. The locking is going to be provided by vfs_rename() in the following patches. CC: [email protected] Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 3658840 commit 7517ce5

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

fs/udf/namei.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,6 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
793793
if (!empty_dir(new_inode))
794794
goto out_oiter;
795795
}
796-
/*
797-
* We need to protect against old_inode getting converted from
798-
* ICB to normal directory.
799-
*/
800-
inode_lock_nested(old_inode, I_MUTEX_NONDIR2);
801796
retval = udf_fiiter_find_entry(old_inode, &dotdot_name,
802797
&diriter);
803798
if (retval == -ENOENT) {
@@ -806,10 +801,8 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
806801
old_inode->i_ino);
807802
retval = -EFSCORRUPTED;
808803
}
809-
if (retval) {
810-
inode_unlock(old_inode);
804+
if (retval)
811805
goto out_oiter;
812-
}
813806
has_diriter = true;
814807
tloc = lelb_to_cpu(diriter.fi.icb.extLocation);
815808
if (udf_get_lb_pblock(old_inode->i_sb, &tloc, 0) !=
@@ -889,7 +882,6 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
889882
udf_dir_entry_len(&diriter.fi));
890883
udf_fiiter_write_fi(&diriter, NULL);
891884
udf_fiiter_release(&diriter);
892-
inode_unlock(old_inode);
893885

894886
inode_dec_link_count(old_dir);
895887
if (new_inode)
@@ -901,10 +893,8 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
901893
}
902894
return 0;
903895
out_oiter:
904-
if (has_diriter) {
896+
if (has_diriter)
905897
udf_fiiter_release(&diriter);
906-
inode_unlock(old_inode);
907-
}
908898
udf_fiiter_release(&oiter);
909899

910900
return retval;

0 commit comments

Comments
 (0)