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>
This commit is contained in:
parent
7d1311b93e
commit
85cd083b49
@ -1014,7 +1014,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
|
|||||||
|
|
||||||
fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
|
fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
goto out_no_entry;
|
goto out_fail;
|
||||||
cfi.icb.extLength = cpu_to_le32(sb->s_blocksize);
|
cfi.icb.extLength = cpu_to_le32(sb->s_blocksize);
|
||||||
cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location);
|
cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location);
|
||||||
if (UDF_SB(inode->i_sb)->s_lvid_bh) {
|
if (UDF_SB(inode->i_sb)->s_lvid_bh) {
|
||||||
@ -1036,6 +1036,7 @@ out:
|
|||||||
|
|
||||||
out_no_entry:
|
out_no_entry:
|
||||||
up_write(&iinfo->i_data_sem);
|
up_write(&iinfo->i_data_sem);
|
||||||
|
out_fail:
|
||||||
inode_dec_link_count(inode);
|
inode_dec_link_count(inode);
|
||||||
iput(inode);
|
iput(inode);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user