Skip to content

Commit

Permalink
udf: avoid unneeded up_write when fail to add entry in ->symlink
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
chaseyu authored and jankara committed Aug 19, 2014
1 parent 7d1311b commit 85cd083
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/udf/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,

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

out_no_entry:
up_write(&iinfo->i_data_sem);
out_fail:
inode_dec_link_count(inode);
iput(inode);
goto out;
Expand Down

0 comments on commit 85cd083

Please sign in to comment.