Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1123441ybl; Sat, 17 Aug 2019 19:34:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJs5Kue1fWEvo/RDQgUdBBN4tNh9CTY19HnISRakLsikw//4STGAPwApmGScnoIs23VAkh X-Received: by 2002:a62:642:: with SMTP id 63mr18055559pfg.257.1566095650723; Sat, 17 Aug 2019 19:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566095650; cv=none; d=google.com; s=arc-20160816; b=URERQbbmcCbn+IZ9m3IhOmP+iU0vvz3hNDQBLDCn91dxCZK9IxaSCRwJBpphPgLWCM rozVKZN1010e+c5Sd69OwY6tocgvQ8rlLi0Wt8ruAfbKnynMjVshzJi9734/rlrzT0UZ uHOTNMsRs8Okxb7Qfo1ofmX2ML3eiimsXnigZiMiqajaXEGWpg2X571uWHDBHSyPc/W5 Uq8+wIjnEJBHe5kqfiSj00YJGl2zNd6zshhYsgCYj0RkZ8gPsUH8OOOG/sYe1VhUTt40 BYoTFeJNq21Ek0wGY/m7VAK6fpJXs8lNxcgA3Pc6cWsD2v6qip3GBOhoUfxc52f08HP4 t1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=chMdXfotk825PO9swgg+VAwAuaaWOwEFrVfLHlz++j4=; b=ZWa4bORoCxpRWPF4R14blmmpeCYPJRg0VT9Q+byHcZeomJCVVGNGMKLpeZE6/txsrd 3t9YOeSiV66CvuzBpuAaN114zfxfv5fnj1L1fkxiy+PpNLR+OgT0yR9EDyid//5xwB/R WgFeJox+imPNRHYTzk2+Oo6GaAQPrlq28VrAprXAtCw46PGlQbNdxYjSjdDVsQoOVESQ Ob70fq51S9OgwmpgDFA4LICIbThMpPQgGU5KxH95hi0A/xxhrulcHaLHx5WWWV6INr50 KCIA/3SoCgcfwTfOjEEBJzmyF/oOucs3bQAwt/DOqjy0sUmm4rOju3XCZ6dopf2EK+M1 Q7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=Cm8JtLfI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15si7060543plr.87.2019.08.17.19.33.56; Sat, 17 Aug 2019 19:34:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=Cm8JtLfI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726408AbfHRCdC (ORCPT + 99 others); Sat, 17 Aug 2019 22:33:02 -0400 Received: from sonic302-20.consmr.mail.gq1.yahoo.com ([98.137.68.146]:43228 "EHLO sonic302-20.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfHRCdC (ORCPT ); Sat, 17 Aug 2019 22:33:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1566095579; bh=chMdXfotk825PO9swgg+VAwAuaaWOwEFrVfLHlz++j4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=Cm8JtLfIOBgMY/RbDxYoiTqPe9QscmduknXvS7tW6ohHhuM+ZviyrjxR62NyCf7kLEiIT2i1Owa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7pTIOfY1E4A48iMH6_HTkvWvWba20qsQCCGTRf_mqustB oLTQiY2bjwq6xSEabpY8rH9oqz2MWgceNiqRqEWLBN1ooe4_1DKKaKve6IiE8agBzYIuti4Qojdc 9aT5YE4CBzYEV_DzmnOlFJYpdFBF5A.ciczrubEbSKH_K.z5xaFILWLDdBEHgOfKoy7K_2JEvYW4 TbKHvpyi1MOp6uKa2OmKRvnf1dSI4VXluEldXGJefcj6gDGrzZVpaG6bLx.iSWwkYm5vZiE_lvLJ 8sqPH7UyPIdrOomMWz6nXAZA8g1oK_mcKZ9wpuiACpMuBg5YTHlj8Ur7wXey3WpQj.798RtljYRT TSEFmAGo8tWr4G.G6yUq55LaVoRzZ0Y9bt5_YzAANW2pnldflcJlx9x3lnOZynRT7VgzWGPZay.C M8JkT.fxeFLcT3ytLU7nrBxlXqB2ENDd9TMi.iX_fCfsZS2gr5v1sc2ndkzpwAQ8FFndAhbspPmP aa_tbW8pXygD4RXwYlpPyqavECSRcZ97Y_g-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Sun, 18 Aug 2019 02:32:59 +0000 Received: by smtp418.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 248360bfecbb1cc8d8e234253b4a5d4d; Sun, 18 Aug 2019 02:32:54 +0000 (UTC) Date: Sun, 18 Aug 2019 10:32:45 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Chao Yu , Richard Weinberger , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-fsdevel@vger.kernel.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Fang Wei , Gao Xiang , stable@vger.kernel.org Subject: Re: [PATCH v2] staging: erofs: fix an error handling in erofs_readdir() Message-ID: <20190818023240.GA7739@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20190818014835.5874-1-hsiangkao@aol.com> <20190818015631.6982-1-hsiangkao@aol.com> <20190818022055.GA14592@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190818022055.GA14592@bombadil.infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Willy, On Sat, Aug 17, 2019 at 07:20:55PM -0700, Matthew Wilcox wrote: > On Sun, Aug 18, 2019 at 09:56:31AM +0800, Gao Xiang wrote: > > @@ -82,8 +82,12 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx) > > unsigned int nameoff, maxsize; > > > > dentry_page = read_mapping_page(mapping, i, NULL); > > - if (IS_ERR(dentry_page)) > > - continue; > > + if (IS_ERR(dentry_page)) { > > + errln("fail to readdir of logical block %u of nid %llu", > > + i, EROFS_V(dir)->nid); > > + err = PTR_ERR(dentry_page); > > + break; > > I don't think you want to use the errno that came back from > read_mapping_page() (which is, I think, always going to be -EIO). > Rather you want -EFSCORRUPTED, at least if I understand the recent > patches to ext2/ext4/f2fs/xfs/... Thanks for your reply and noticing this. :) Yes, as I talked with you about read_mapping_page() in a xfs related topic earlier, I think I fully understand what returns here. I actually had some concern about that before sending out this patch. You know the status is PG_uptodate is not set and PG_error is set here. But we cannot know it is actually a disk read error or due to corrupted images (due to lack of page flags or some status, and I think it could be a waste of page structure space for such corrupted image or disk error)... And some people also like propagate errors from insiders... (and they could argue about err = -EFSCORRUPTED as well..) I'd like hear your suggestion about this after my words above? still return -EFSCORRUPTED? Thanks, Gao Xiang