From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gao Xiang Date: Wed, 18 Sep 2019 08:33:08 +0000 Subject: Re: [PATCH -next] erofs: fix return value check in erofs_read_superblock() Message-Id: <20190918083308.GA30134@architecture4> List-Id: References: <20190918083033.47780-1-weiyongjun1@huawei.com> In-Reply-To: <20190918083033.47780-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Wei Yongjun Cc: Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Gao Xiang , linux-erofs@lists.ozlabs.org Hi Yongjun, On Wed, Sep 18, 2019 at 08:30:33AM +0000, Wei Yongjun wrote: > In case of error, the function read_mapping_page() returns > ERR_PTR() not NULL. The NULL test in the return value check > should be replaced with IS_ERR(). > > Fixes: fe7c2423570d ("erofs: use read_mapping_page instead of sb_bread") > Signed-off-by: Wei Yongjun Reviewed-by: Gao Xiang Right... That is my mistake on recent killing bh transformation... I have no idea this patch could be merged for -rc1 since I don't know Greg could still accept patches or freezed... Since it's an error handling path and trivial, if it's some late, could I submit this later after erofs is merged into mainline (if it's ok) for -rc1? (or maybe -rc2?) Thanks, Gao Xiang > --- > fs/erofs/super.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > index caf9a95173b0..0e369494f2f2 100644 > --- a/fs/erofs/super.c > +++ b/fs/erofs/super.c > @@ -105,9 +105,9 @@ static int erofs_read_superblock(struct super_block *sb) > int ret; > > page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL); > - if (!page) { > + if (IS_ERR(page)) { > erofs_err(sb, "cannot read erofs superblock"); > - return -EIO; > + return PTR_ERR(page); > } > > sbi = EROFS_SB(sb); > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA7E4C4CEC4 for ; Wed, 18 Sep 2019 08:34:33 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54B4621906 for ; Wed, 18 Sep 2019 08:34:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54B4621906 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46YCvV57WhzF4Z9 for ; Wed, 18 Sep 2019 18:34:30 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=huawei.com (client-ip=45.249.212.255; helo=huawei.com; envelope-from=gaoxiang25@huawei.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46YCvK5kQ5zF48x for ; Wed, 18 Sep 2019 18:34:21 +1000 (AEST) Received: from DGGEMM401-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id B5078A00FAE7FCD80D5B; Wed, 18 Sep 2019 16:34:16 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM401-HUB.china.huawei.com (10.3.20.209) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Sep 2019 16:34:15 +0800 Received: from architecture4 (10.140.130.215) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 18 Sep 2019 16:34:15 +0800 Date: Wed, 18 Sep 2019 16:33:08 +0800 From: Gao Xiang To: Wei Yongjun Subject: Re: [PATCH -next] erofs: fix return value check in erofs_read_superblock() Message-ID: <20190918083308.GA30134@architecture4> References: <20190918083033.47780-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190918083033.47780-1-weiyongjun1@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme703-chm.china.huawei.com (10.1.199.99) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Gao Xiang , linux-erofs@lists.ozlabs.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" Hi Yongjun, On Wed, Sep 18, 2019 at 08:30:33AM +0000, Wei Yongjun wrote: > In case of error, the function read_mapping_page() returns > ERR_PTR() not NULL. The NULL test in the return value check > should be replaced with IS_ERR(). > > Fixes: fe7c2423570d ("erofs: use read_mapping_page instead of sb_bread") > Signed-off-by: Wei Yongjun Reviewed-by: Gao Xiang Right... That is my mistake on recent killing bh transformation... I have no idea this patch could be merged for -rc1 since I don't know Greg could still accept patches or freezed... Since it's an error handling path and trivial, if it's some late, could I submit this later after erofs is merged into mainline (if it's ok) for -rc1? (or maybe -rc2?) Thanks, Gao Xiang > --- > fs/erofs/super.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > index caf9a95173b0..0e369494f2f2 100644 > --- a/fs/erofs/super.c > +++ b/fs/erofs/super.c > @@ -105,9 +105,9 @@ static int erofs_read_superblock(struct super_block *sb) > int ret; > > page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL); > - if (!page) { > + if (IS_ERR(page)) { > erofs_err(sb, "cannot read erofs superblock"); > - return -EIO; > + return PTR_ERR(page); > } > > sbi = EROFS_SB(sb); > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C904C4CEC4 for ; Wed, 18 Sep 2019 08:34:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3026321907 for ; Wed, 18 Sep 2019 08:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730498AbfIRIeT (ORCPT ); Wed, 18 Sep 2019 04:34:19 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:58664 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726336AbfIRIeT (ORCPT ); Wed, 18 Sep 2019 04:34:19 -0400 Received: from DGGEMM401-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id B5078A00FAE7FCD80D5B; Wed, 18 Sep 2019 16:34:16 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM401-HUB.china.huawei.com (10.3.20.209) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 18 Sep 2019 16:34:15 +0800 Received: from architecture4 (10.140.130.215) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 18 Sep 2019 16:34:15 +0800 Date: Wed, 18 Sep 2019 16:33:08 +0800 From: Gao Xiang To: Wei Yongjun CC: Greg Kroah-Hartman , Gao Xiang , Chao Yu , Chao Yu , , , Subject: Re: [PATCH -next] erofs: fix return value check in erofs_read_superblock() Message-ID: <20190918083308.GA30134@architecture4> References: <20190918083033.47780-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190918083033.47780-1-weiyongjun1@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme703-chm.china.huawei.com (10.1.199.99) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yongjun, On Wed, Sep 18, 2019 at 08:30:33AM +0000, Wei Yongjun wrote: > In case of error, the function read_mapping_page() returns > ERR_PTR() not NULL. The NULL test in the return value check > should be replaced with IS_ERR(). > > Fixes: fe7c2423570d ("erofs: use read_mapping_page instead of sb_bread") > Signed-off-by: Wei Yongjun Reviewed-by: Gao Xiang Right... That is my mistake on recent killing bh transformation... I have no idea this patch could be merged for -rc1 since I don't know Greg could still accept patches or freezed... Since it's an error handling path and trivial, if it's some late, could I submit this later after erofs is merged into mainline (if it's ok) for -rc1? (or maybe -rc2?) Thanks, Gao Xiang > --- > fs/erofs/super.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > index caf9a95173b0..0e369494f2f2 100644 > --- a/fs/erofs/super.c > +++ b/fs/erofs/super.c > @@ -105,9 +105,9 @@ static int erofs_read_superblock(struct super_block *sb) > int ret; > > page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL); > - if (!page) { > + if (IS_ERR(page)) { > erofs_err(sb, "cannot read erofs superblock"); > - return -EIO; > + return PTR_ERR(page); > } > > sbi = EROFS_SB(sb); > > >