From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753672AbcEZLbl (ORCPT ); Thu, 26 May 2016 07:31:41 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:43941 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753382AbcEZLbj (ORCPT ); Thu, 26 May 2016 07:31:39 -0400 Subject: Re: [PATCH v2] f2fs: Return the errno to the caller to avoid using a wrong page To: , , , , References: <1464181261-3980-1-git-send-email-yunlong.song@huawei.com> <1464237511-2181-1-git-send-email-yunlong.song@huawei.com> CC: , , , , , , From: Yunlong Song Message-ID: <5746DE64.2040908@huawei.com> Date: Thu, 26 May 2016 19:30:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1464237511-2181-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.74.205] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0205.5746DE7F.0298,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: aefe2ac25131294ad468d5af63402f66 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > page_hit: > - f2fs_bug_on(sbi, nid != nid_of_node(page)); > + if(nid != nid_of_node(page)) { should add "unlikely" here, will fix this in v3 patch. > + f2fs_bug_on(sbi, 1); > + ClearPageUptodate(page); > +out_err: > + f2fs_put_page(page, 1); > + return ERR_PTR(-EIO); > + } > return page; > } > > -- Thanks, Yunlong Song