linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to release inode page in get_new_data_page
@ 2015-07-09 10:20 Chao Yu
  2015-07-11  0:17 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Chao Yu @ 2015-07-09 10:20 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel

get_new_data_page should release inode page when we encounter any
error in its procedure, but there is one error path didn't cover
this, fix it.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 08dfdc6..ea8898b 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -397,8 +397,10 @@ struct page *get_new_data_page(struct inode *inode,
 	int err;
 repeat:
 	page = grab_cache_page(mapping, index);
-	if (!page)
+	if (!page) {
+		f2fs_put_page(ipage, 1);
 		return ERR_PTR(-ENOMEM);
+	}
 
 	set_new_dnode(&dn, inode, ipage, NULL, 0);
 	err = f2fs_reserve_block(&dn, index);
-- 
2.4.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-14 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 10:20 [PATCH] f2fs: fix to release inode page in get_new_data_page Chao Yu
2015-07-11  0:17 ` Jaegeuk Kim
2015-07-11  2:02   ` [f2fs-dev] " Chao Yu
2015-07-13 23:25     ` Jaegeuk Kim
2015-07-14 10:13       ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).