Skip to content

Commit 85cd083

Browse files
chaseyujankara
authored andcommitted
udf: avoid unneeded up_write when fail to add entry in ->symlink
We have released the ->i_data_sem before invoking udf_add_entry(), so in following error path, we should not release this lock again. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 7d1311b commit 85cd083

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/udf/namei.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
10141014

10151015
fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
10161016
if (!fi)
1017-
goto out_no_entry;
1017+
goto out_fail;
10181018
cfi.icb.extLength = cpu_to_le32(sb->s_blocksize);
10191019
cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location);
10201020
if (UDF_SB(inode->i_sb)->s_lvid_bh) {
@@ -1036,6 +1036,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
10361036

10371037
out_no_entry:
10381038
up_write(&iinfo->i_data_sem);
1039+
out_fail:
10391040
inode_dec_link_count(inode);
10401041
iput(inode);
10411042
goto out;

0 commit comments

Comments
 (0)