diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-08-08 21:49:31 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-08-19 12:29:30 -0400 |
commit | 85cd083b498572fb9fa575cce3ed910c8ee84294 (patch) | |
tree | 2f4d62cbbefd31388b5af4b576a02f0b71e91142 /fs/udf | |
parent | 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff) |
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.c | 3 |
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, | |||
1014 | 1014 | ||
1015 | fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); | 1015 | fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); |
1016 | if (!fi) | 1016 | if (!fi) |
1017 | goto out_no_entry; | 1017 | goto out_fail; |
1018 | cfi.icb.extLength = cpu_to_le32(sb->s_blocksize); | 1018 | cfi.icb.extLength = cpu_to_le32(sb->s_blocksize); |
1019 | cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location); | 1019 | cfi.icb.extLocation = cpu_to_lelb(iinfo->i_location); |
1020 | if (UDF_SB(inode->i_sb)->s_lvid_bh) { | 1020 | if (UDF_SB(inode->i_sb)->s_lvid_bh) { |
@@ -1036,6 +1036,7 @@ out: | |||
1036 | 1036 | ||
1037 | out_no_entry: | 1037 | out_no_entry: |
1038 | up_write(&iinfo->i_data_sem); | 1038 | up_write(&iinfo->i_data_sem); |
1039 | out_fail: | ||
1039 | inode_dec_link_count(inode); | 1040 | inode_dec_link_count(inode); |
1040 | iput(inode); | 1041 | iput(inode); |
1041 | goto out; | 1042 | goto out; |