summaryrefslogtreecommitdiff
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-03-29 15:30:40 +0800
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-04-02 09:56:27 +0900
commitd54c795b495b9bd417e482286c832c9a8eb210ae (patch)
treed9cb8d56270bd124e7db2660d336d7afa1c7e6e7 /fs/f2fs/inline.c
parent2d7b822ad9daf0ea903accacaa89340ddd3f201f (diff)
f2fs: fix error path when fail to read inline data
We should unlock page in ->readpage() path and also should unlock & release page in error path of ->write_begin() to avoid deadlock or memory leak. So let's add release code to fix the problem when we fail to read inline data. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 31ee5b164ff9..383db1fabcf4 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -45,8 +45,10 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
}
ipage = get_node_page(sbi, inode->i_ino);
- if (IS_ERR(ipage))
+ if (IS_ERR(ipage)) {
+ unlock_page(page);
return PTR_ERR(ipage);
+ }
zero_user_segment(page, MAX_INLINE_DATA, PAGE_CACHE_SIZE);