From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 996BF606A31A for ; Mon, 30 Nov 2026 20:12:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Azt7V4p5 Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jdZtm1fTmz2xyh; Tue, 01 Dec 2026 07:12:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796069536; cv=none; b=AtRJUAB+8RyBMNLfa/slH4Qzv1m0/4sQbbVfMtJao7qNOQWH0YZjygBd+p82w+3nHtwFuoOk39+uDVNum+QbJtk9LGTdnEl2+3Wt10hhRTcELLCkzn7sYNxO2AV5BgT83rVy0R0x73hrCbGW9hmkkVGqFUnfT9SAJW6En9YuxF6BXT7ITXpDEf0EQqGNKjYdvqWY8xeO0oiwdmqbyCPITUr9LcOud5htXkqWn6WHPznI6I148JMU/IJHJhgsKsmsNMCHRrfiqfpDrlTlGt9Q87NsPOKHL/5VBRvt+mZu3vGGvxQvbKMK+1e4uYThu1jxTLXWhZbYbUlasZvblIylOg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796069536; c=relaxed/relaxed; bh=awGZWkV6/KJg28jLwzUsuiFKNV3OKeIjQpw/t7I/SKc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iWGu0TUReHDoaLTeJ0wOr4Y5y2l3WkMJPb1gDxiFo2ZJOY8Vfdmb+42JQJ2eAxl0uM5mM30D8MLTB7+GsNqXgZri62Bp9TX679MRy92l0Eo1dRaxnrQ1bHTy2mEO/KOc9RYPHoUigkHhh00EThKm0xkjetbQwI03CqpaPH8AoCkgl0B2+GzPCDSep3dz5qNxld44rfgVejO1h4Bxdzdwsa+ukwwnDkUZw2nObw6u7XnhtwdHSZLLiOFKD5yJPtCHHeP7Y9cBSnm1EnhJ9KhShj38mdhcCZVuNqXfZCxCZ0+oHP53YD9jfmxvWcnB4PcO8JIaIyqCKqu2y4c52V/Q2g== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Azt7V4p5; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=xiang@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Azt7V4p5; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=xiang@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jdZtl38y6z2xL5 for ; Tue, 01 Dec 2026 07:12:15 +1100 (AEDT) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id DB7DE41073; Mon, 30 Nov 2026 20:12:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76F721F00899; Mon, 30 Nov 2026 20:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796069532; bh=awGZWkV6/KJg28jLwzUsuiFKNV3OKeIjQpw/t7I/SKc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Azt7V4p5QhpP8FNZGeJmimXe6iUTAlJF9Kk4XrmfP0eZERFvkGvKZ6323szKDGf8k sw62I3Tmv+w/8j0PH+XGa8Vzq+zaWT9fDbTM8q/xpVYAMNnUXqOtQNRNOGKhqkRfuV iS/RLiSs+BMo13I1Qkg4EG57o8wVyuq5nZmXs0dMRpso+byK6fQ0R7kGKB6Zloc3dR ogCCj+/dlaxQG2jEOBg7j/3TxMGJkt/4AcmwK7vzCkRQ82g3kEuw676pq7MjPE7Wdq ouwNxrLnXEi/JHst1VljO8E7K+SY/Fp0Bk9EVow9/Vd0wMapsrxzDRjuVDyRAYHd8f LM5zvzVU2DQWA== Date: Mon, 30 Nov 2026 21:12:06 +0100 From: Gao Xiang To: Zhiguo Niu Cc: xiang@kernel.org, chao@kernel.org, ke.wang@unisoc.com, zbestahu@gmail.com, jefflexu@163.com, dhavale@google.com, hongbohbli@tencent.com, guochunhai@vivo.com, linux-erofs@lists.ozlabs.org, Zhiguo Niu Subject: Re: [PATCH] erofs: print error code in erofs_err() of erofs_readdir Message-ID: Mail-Followup-To: Zhiguo Niu , xiang@kernel.org, chao@kernel.org, ke.wang@unisoc.com, zbestahu@gmail.com, jefflexu@163.com, dhavale@google.com, hongbohbli@tencent.com, guochunhai@vivo.com, linux-erofs@lists.ozlabs.org, Zhiguo Niu References: <20261127025636.1333457-1-zhiguo.niu@unisoc.com> X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, Nov 30, 2026 at 10:05:05AM +0800, Zhiguo Niu wrote: > Hi Xiang, > Sorry, the contents of previous mail were a bit messy. > > Gao Xiang 于2026年11月27日周五 12:08写道: > > > > Hi Zhiguo, > > > > On Fri, Nov 27, 2026 at 10:56:36AM +0800, Zhiguo Niu wrote: > > > Under system stress tests, the following log frequently shows up: > > > erofs: (device dm-8): erofs_readdir: failed to readdir of logical > > > block 0 of nid 124 > > > > > > Without the err value, it is hard to tell whether the failure was > > > caused by an interrupted read (e.g. -EINTR) or a real I/O problem. > > > Print the error code so that we can get more clues to the problem. > > > > > > Also fix the similar codes in other erofs_err() call sites where a > > > real error code is available but not printed: > > > - erofs_read_superblock: "cannot read erofs superblock" > > > - z_erofs_init_pcpu_workers: per-cpu workers allocation and CPU > > > hotplug init > > > - z_erofs_readahead: "readahead error at folio ... @ nid ..." > > > > > > Signed-off-by: Zhiguo Niu > > > --- > > > fs/erofs/dir.c | 4 ++-- > > > fs/erofs/super.c | 2 +- > > > fs/erofs/zdata.c | 8 ++++---- > > > 3 files changed, 7 insertions(+), 7 deletions(-) > > > > > > diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c > > > index 4aa52a5f204a..69aea8a7c3dc 100644 > > > --- a/fs/erofs/dir.c > > > +++ b/fs/erofs/dir.c > > > @@ -83,9 +83,9 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx) > > > > > > de = erofs_bread(&buf, dbstart, true); > > > if (IS_ERR(de)) { > > > > I guess the correct way is that we shouldn't error out -EINTR. > OK > > > > > - erofs_err(sb, "failed to readdir of logical block %llu of nid %llu", > > > - erofs_blknr(sb, dbstart), EROFS_I(dir)->nid); > > > err = PTR_ERR(de); > > > + erofs_err(sb, "failed to readdir of logical block %llu of nid %llu: %d", > > > + erofs_blknr(sb, dbstart), EROFS_I(dir)->nid, err); > > > > you should just use %pe here directly. > > but for this point, and also considering the earlier suggestion to "should not > error out -EINTR" ,this would be somewhat redundant; it might look > something like this: > if (IS_ERR(de)) { > if (de != ERR_PTR(-EINTR)) > erofs_err(sb, "failed to readdir of logical block %llu of nid > %llu: %pe" , erofs_blknr(sb, dbstart), EROFS_I(dir)->nid, de); > err = PTR_ERR(de); > break ; > } This one is actually better since it could print error codes in the pretty form. Could you send another version so I can apply soon? Thanks, Gao Xiang