Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1117699ybl; Sat, 17 Aug 2019 19:24:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAGX03qSBlxYt9QsIyWXBV8+AFY5DMAeNHShfk/vhdkqnwkvRwcLIq4SDr2YtlX5F4Y7KK X-Received: by 2002:a63:24a:: with SMTP id 71mr13876192pgc.273.1566095056296; Sat, 17 Aug 2019 19:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566095056; cv=none; d=google.com; s=arc-20160816; b=qCDvUflfzrM2T8SsHMW4GBVC7bQafWDghDCSW86oY9gLuOIOrOOMd+VostozIRzhK9 7oawUhYW+4g2NynrNr7z2JTDq6TYXxJ4EFTF8c1nl5xp7rL52Yf98hC0DPOt05bU3EE9 A74eDkhz7BkB9YjN/nMcQxGhVOufWfpsaMFjNSocQesy9n4Yzzos2nncGEhF704emcUA s4gBNkR98EenJyKMEWXzdVRd0DpoO572G4uto37A+uCT+oERG0u7M/ACwhwo1axg8Mg4 ojYK3t6hegwQg6cKncu/4dwvKY6xUoKMd88AIu9dSFKyGkkR4pT7EUuUDsh2b9kHGKW5 bq2w== 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=rTepqUiIUx2nnEvuuf1IfBTS43BjeweB+IeE+bLV2H0=; b=aXkvoh/SxUepqB2l/7dEAMPlJyu+A27rrV3kWPQZvYp6yUcZvdFIZb2lJsYRZugHXi e/M3ivX2bI5lVehDJeLcOVMNYpLp6WUqRiZg/GwXPhOl3bxvs/lkgj+yebguBOV7RjYP RnnfJ4hu6o5Tt686Nve9l1/UC1oQkgLhPq2/R3a8fKudZLaSzzPfP0rmqjmhn5PhY0j1 ZdXO0v86KH6HHJeRcEwwVe5t9NBRrX8AbBxHH3kDjJ1N/vAHmAVBlmWVQ2kdn/fA/ReK NTwn0m5fRyF0kU3BKt+f0ChpRjKeA858StoNIzndjJ1VLi0YD6mbe+ITSeXvkwDvSLm4 L2cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jA5GcXNq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si7078679plp.204.2019.08.17.19.24.01; Sat, 17 Aug 2019 19:24:16 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jA5GcXNq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfHRCVG (ORCPT + 99 others); Sat, 17 Aug 2019 22:21:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39230 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726208AbfHRCVG (ORCPT ); Sat, 17 Aug 2019 22:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rTepqUiIUx2nnEvuuf1IfBTS43BjeweB+IeE+bLV2H0=; b=jA5GcXNq9MfyEvl9UgqfCv2uN KduJxuHrPS02dFDVNAioWXKihTJvtK+MC0OIWgHKRKgWVRh4vlxhFM2sqx+9PkAGFxQrdG3sbHW/Q YLQSj9SqVXiZFbfvnfC2q5R/l8VeTCUNqYUCKj9DL5w+R8UYF9PUDDPy5h54axO+TzRK/pgQQZqmE sKb71/Rdfb4ZEcyOREIhAspSOIeiiM14fnbtnYO7e6jxzsJ7jaEW+encFkdeMqG/W9MaXcZS7Y/zA w/Dgbb9xXuEE95rAY/kK8se2W7Yn2s8XtVyvkFNLYO3smemDaVVdEajDo74CszfjMM7gXz/Flg7uU +/+5Qy5SA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hzAoR-0001XG-Pw; Sun, 18 Aug 2019 02:20:55 +0000 Date: Sat, 17 Aug 2019 19:20:55 -0700 From: Matthew Wilcox To: Gao Xiang 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: <20190818022055.GA14592@bombadil.infradead.org> References: <20190818014835.5874-1-hsiangkao@aol.com> <20190818015631.6982-1-hsiangkao@aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190818015631.6982-1-hsiangkao@aol.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/...