From mboxrd@z Thu Jan 1 00:00:00 1970 From: Younger Liu Subject: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page() Date: Wed, 11 Dec 2013 19:29:18 +0800 Message-ID: <52A84C8E.5090209@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: joern@logfs.org, prasadjoshi.linux@gmail.com, logfs@logfs.org, kernel , fs-devel , liuyiyang@hisense.com To: Andrew Morton Return-path: Received: from mail-pb0-f50.google.com ([209.85.160.50]:36626 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051Ab3LKL3b (ORCPT ); Wed, 11 Dec 2013 06:29:31 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Younger Liu In get_mapping_page(), after calling find_or_create_page(), the return value should be checked. This patch has been provided: http://www.spinics.net/lists/linux-fsdevel/msg66948.html but not been applied now. Signed-off-by: Younger Liu Cc: Younger Liu Cc: Vyacheslav Dubeyko Reviewed-by: Prasad Joshi --- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c index d448a77..7f9b096 100644 --- a/fs/logfs/segment.c +++ b/fs/logfs/segment.c @@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index, page = read_cache_page(mapping, index, filler, sb); else { page = find_or_create_page(mapping, index, GFP_NOFS); - unlock_page(page); + if (page) + unlock_page(page); } return page; } -- 1.7.9.5