summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-08-09 03:49:31 +0200
committerJan Kara <jack@suse.cz>2014-08-19 18:29:30 +0200
commit85cd083b498572fb9fa575cce3ed910c8ee84294 (patch)
tree2f4d62cbbefd31388b5af4b576a02f0b71e91142 /fs/udf
parentLinux 3.17-rc1 (diff)
downloadlinux-85cd083b498572fb9fa575cce3ed910c8ee84294.tar.xz
linux-85cd083b498572fb9fa575cce3ed910c8ee84294.zip
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>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/namei.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 9737cba1357d..83a06001742b 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -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) {
@@ -1036,6 +1036,7 @@ out:
out_no_entry:
up_write(&iinfo->i_data_sem);
+out_fail:
inode_dec_link_count(inode);
iput(inode);
goto out;