summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-04-16 14:22:50 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-07 10:21:54 +0900
commit15c6e3aae68d6167cba063387a59968f811c8268 (patch)
tree4a28d9b58e4ccfaaabd1cd5076c1752facd8639e /fs/f2fs/inline.c
parent76f60268e70a700c04c85e1b0d520c94062a40a2 (diff)
downloadlinux-stable-15c6e3aae68d6167cba063387a59968f811c8268.tar.gz
linux-stable-15c6e3aae68d6167cba063387a59968f811c8268.tar.bz2
linux-stable-15c6e3aae68d6167cba063387a59968f811c8268.zip
f2fs: fix to unlock f2fs_lock at the omitted error case
If it occurs an error, we should call f2fs_unlock_op. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 383db1fabcf4..3258c7cf00d5 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -81,8 +81,10 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
f2fs_lock_op(sbi);
ipage = get_node_page(sbi, inode->i_ino);
- if (IS_ERR(ipage))
- return PTR_ERR(ipage);
+ if (IS_ERR(ipage)) {
+ err = PTR_ERR(ipage);
+ goto out;
+ }
/*
* i_addr[0] is not used for inline data,
@@ -90,10 +92,8 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
*/
set_new_dnode(&dn, inode, ipage, NULL, 0);
err = f2fs_reserve_block(&dn, 0);
- if (err) {
- f2fs_unlock_op(sbi);
- return err;
- }
+ if (err)
+ goto out;
zero_user_segment(page, MAX_INLINE_DATA, PAGE_CACHE_SIZE);
@@ -118,6 +118,7 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
sync_inode_page(&dn);
f2fs_put_dnode(&dn);
+out:
f2fs_unlock_op(sbi);
return err;
}