From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page() Date: Thu, 18 Jul 2013 16:02:56 +0400 Message-ID: References: <51E51353.3060501@huawei.com> Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: Younger Liu , Andrew Morton , joern@logfs.org, logfs@logfs.org, "linux-fsdevel@vger.kernel.org" To: Prasad Joshi Return-path: Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:45632 "HELO oproxy6-pub.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757509Ab3GRL5s convert rfc822-to-8bit (ORCPT ); Thu, 18 Jul 2013 07:57:48 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Jul 17, 2013, at 8:23 AM, Prasad Joshi wrote: > On Tue, Jul 16, 2013 at 3:03 PM, Younger Liu wrote: >> >> In get_mapping_page(), after calling find_or_create_page(), >> the return value should be checked. >> >> Signed-off-by: Younger Liu > > Thanks applied. > > Regards, > Prasad > >> --- >> 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 038da09..2641e94 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) Sorry, but as I understand, this code breaks kernel coding style. With the best regards, Vyacheslav Dubeyko. >> + unlock_page(page); >> } >> return page; >> } >> -- 1.7.9.7 >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html