Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1536408ybl; Sun, 18 Aug 2019 05:34:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg8wvHeX2Dh3W6oQy77QlUgQw9wvr1W3ccN+tsevZ0ynJ3Tob5QmCnQTN0UZdSOASMcF4M X-Received: by 2002:a17:902:fe06:: with SMTP id g6mr17893581plj.265.1566131666953; Sun, 18 Aug 2019 05:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566131666; cv=none; d=google.com; s=arc-20160816; b=MMUTzUBp98f/A5mvQtbDuOxCC7niccPw0WoNt7AEOcls95sHRNQ4eh4ZSIeXN3RI3I 3ch4NvTNVhJfvFct0eA+moNiIV1Ruf3XPFLwtZ1NtkDPAnDhtOc6+bf+pZsBDFkpNSN7 ASjBnw3G/0gHrsu2yGtHSEj4sx33xnvwyyv/Zi+pr1sC797mhssoJaf1Fj/0TAralUhR dj2/wrCkW6I1+Ae83jZxBL//tUlZlqKai4m1dVB4pWwPMsKHChxFrXWiVze1YCUsWV9I RrNY+yfZDeKpzBvD5855Izz0GondMhwGBzhKr1xL0BD44p9AwDus713VtTlSbHRfgEMz XUzw== 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=xzB0N5KXoocholH/YOkGDtfICAB0yGZ8RmgdPY4pQBk=; b=zr4uJ2Shbr6eGvS7teAh2Ylu6JAGeyhpKoCpsSp7aFMyctU1lItjxOods7BrIbpvdw sF1zws2EQlAY/ftByEDI77AFy4+s52KjAi+45qQE0/cKnVaZuY5f0Bt3lptBEwpemlPQ kMjLUuMuMZVVtvQy5BPOBy7L7pp4dTvSrl+A/Ax+iZEyUd0QUQX2P6jSpBkZSJM85ffh f4hPpRhpQEb45LZwx6gXkWSTG1dIGquNj/PZM9ZaW/ZKnhxIlTa4rMoTEYIL/a1/bcvs gXKv60i/zZ8hKL0vpStdvS5dEC26ZvWNS+0JjnkM9b45QAAB9HYlvxLY7A+9HspHVQJ2 HZFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=D8+f2Wvk; 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 i185si7627272pge.505.2019.08.18.05.34.12; Sun, 18 Aug 2019 05:34:26 -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=D8+f2Wvk; 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 S1726672AbfHRMdZ (ORCPT + 99 others); Sun, 18 Aug 2019 08:33:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54184 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbfHRMdY (ORCPT ); Sun, 18 Aug 2019 08:33:24 -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=xzB0N5KXoocholH/YOkGDtfICAB0yGZ8RmgdPY4pQBk=; b=D8+f2WvkG3p4WYc9upT4VTsHh f5SeQ1l6W8TPkD72cRq3W/6BHXnBllsfy1ZRsOACKqpIfcdUUAeByjXNJlgPSq9O6kKyUS/vDaaB4 TMH0oiTgiT4gbsjz/lmiTBkQV/X1Ifiq/f5X6PXYemIACo1rf3KK5yxYaJhdlgAXXPwEktdLrNdly 3vYZcGes35B0aRNrWAwQ16HHXF/hiODC26eK1gpfhSbGTlhsZcluX2QuzZAsAYbte77evggr1Piz0 UKbu6+itGXx4A24C1YJJc27Hgbnu4ZqXCrZ0eNPmmHhmA+VZctKuXUPyxYACWV2lHw2uck+Y+2NYi qkVoejm9Q==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hzKN0-0004ZF-AZ; Sun, 18 Aug 2019 12:33:14 +0000 Date: Sun, 18 Aug 2019 05:33:14 -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 v3 RESEND] staging: erofs: fix an error handling in erofs_readdir() Message-ID: <20190818123314.GA29733@bombadil.infradead.org> References: <20190818030109.GA8225@hsiangkao-HP-ZHAN-66-Pro-G1> <20190818032111.9862-1-hsiangkao@aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190818032111.9862-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 11:21:11AM +0800, Gao Xiang wrote: > + if (dentry_page == ERR_PTR(-ENOMEM)) { > + errln("no memory to readdir of logical block %u of nid %llu", > + i, EROFS_V(dir)->nid); I don't think you need the error message. If we get a memory allocation failure, there's already going to be a lot of spew in the logs from the mm system. And if we do fail to allocate memory, we don't need to know the logical block number or the nid -- it has nothiing to do with those; the system simply ran out of memory. > + err = -ENOMEM; > + break; > + } else if (IS_ERR(dentry_page)) { > + errln("fail to readdir of logical block %u of nid %llu", > + i, EROFS_V(dir)->nid); > + err = -EFSCORRUPTED; > + break; > + } > > de = (struct erofs_dirent *)kmap(dentry_page); > > -- > 2.17.1 >