Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp178657rwd; Tue, 30 May 2023 18:20:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/RlgCrc631tgrfaQalGm3aYUW0lvF0rdDTASnpWrXnnv35+vJYuVbP+1W3Dt8K3QrX7bB X-Received: by 2002:a05:6830:4785:b0:6a6:10d:73b3 with SMTP id df5-20020a056830478500b006a6010d73b3mr465561otb.36.1685496048890; Tue, 30 May 2023 18:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685496048; cv=none; d=google.com; s=arc-20160816; b=NBrmrEgSGwlMY2rY185fUlYO5/kejfEnoYPj5TcGJBQ9HwxIFquqsv7Mh0A2s826io zxLowXf4AvqWY0hENwnRSB92nVDjFqQ0zBcWkRgw2Q2QOF+07z3d3BYxVOyu4PCL6xwR p07rnfHlTFlaeEhaSrSEm6/S4Q513t6U22dwkI7pAQ2oKQx3PwMIYHfRO8FzBiGpnwJE P7bsQ/KkhN0OIkQchq5TAd7uffHurMdD665QUJd0oaUikyQ2fomgzjk9kdkc/Ei118bf Dqn6vmJAkcSH03iGR24tAIfj9WEV9pgv9d7Qyr0YEgS3+aE6UUOmAlczZY8+aNmFWeXH gIug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IGkjEIR3tYxVpvH1fGfkgcKm+HWeov2ORNo1BWuLsvg=; b=BHQ3MH3nwN0EgXDbR44L4SucKGiuZfT5oILMR8uVZp2Cyc9VGORw1YzGUjWcMRWV03 C3RVsEDMzvw2YDpebVrobOP010C9xBQ2m6O0fPxM2ulpAyDK1YBgvpXljtTEN0YMkLg+ on8WJ/AQH8ODJe/fBxFoR/O6APyj/qmYm8NwQooHMDYeV5mss4+cspBPI8KsWeUrKfez 4+YYVwMcLMOHliLwhMn0mHPRu1SItpPuMPeHkf9LUbUqLlo4C2khrnyaZ69MD+w1zEJR IeSe6dSp8onOaP07ueMW5rXpVXS+0d8AlzamT9lidxGk9ioHiKezh/3OKO8bMp1M3eVh qbog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jCfFDcy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c28-20020aa7953c000000b0063473a51539si2532871pfp.398.2023.05.30.18.20.33; Tue, 30 May 2023 18:20:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jCfFDcy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbjEaBMB (ORCPT + 99 others); Tue, 30 May 2023 21:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233929AbjEaBL7 (ORCPT ); Tue, 30 May 2023 21:11:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDAC110A for ; Tue, 30 May 2023 18:11:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6BC69635CB for ; Wed, 31 May 2023 01:11:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 914ACC433EF; Wed, 31 May 2023 01:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685495517; bh=L7vmx3k0L13foFTSG6sEEgottZQqCjEMpZkj1eF386o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jCfFDcy2akosC8dx+YAE2JeEp6yeHUc7Lo0BUN1lTvlkjThF7cqXLN4b4i3zC4M6Q MjI1BzbWTnMwgcjheCZdTsaGm+EhRLy0TjTbXcKeNs4UZ9u6mYL8uSW8AO9mgCa6KY 91Og4Is0D88RLZh1vy7mrNHpn74gPH9JTERMwmoOlDe2/x5tvFjfmIxpuyi0q8bWnl ZJSyUPI4/CWSX5AXAdKXYCJf4O5noJ6LwZ/cG2lbSsxUG8X7F6+rkNlSu92I/9KJrj lbzsFPuCMOJWZD7SZWjuu+k/X6mYbVyzFLsZiFtD4lVvTHuUGVudBW2w249z/Rt9TT xY1YiZ3XJKdsA== Message-ID: <9f2948cb-a4b0-bced-1d11-cf9fc712ba9b@kernel.org> Date: Wed, 31 May 2023 09:11:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2 1/1] f2fs: fix args passed to trace_f2fs_lookup_end Content-Language: en-US To: Jaegeuk Kim , Wu Bo Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, wubo.oduw@gmail.com References: <20230530012118.74228-1-bo.wu@vivo.com> From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/5/31 7:32, Jaegeuk Kim wrote: > On 05/30, Wu Bo wrote: >> The NULL return of 'd_splice_alias' dosen't mean error. Thus the >> successful case will also return NULL, which makes the tracepoint always >> print 'err=-ENOENT'. >> >> Signed-off-by: Wu Bo >> --- >> fs/f2fs/namei.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c >> index 77a71276ecb1..0c5e4c424eab 100644 >> --- a/fs/f2fs/namei.c >> +++ b/fs/f2fs/namei.c >> @@ -576,8 +576,9 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, >> } >> #endif >> new = d_splice_alias(inode, dentry); >> - err = PTR_ERR_OR_ZERO(new); >> - trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err); >> + if (IS_ERR(new)) >> + err = PTR_ERR(new); >> + trace_f2fs_lookup_end(dir, new ? new : dentry, ino, err); > > Again, new can be an error pointer, and the previous err was supposed to be > zero or -ENOENT. > > case 1) dentry exists: err (0) with new (NULL) --> dentry, err=0 > case 2) dentry exists: err (0) with new (VALID) --> new, err=0 > case 3) dentry exists: err (0) with new (ERR) --> dentry, err=ERR > case 4) no dentry exists: err (-ENOENT) with new (NULL) --> dentry, err=-ENOENT > case 4) no dentry exists: err (-ENOENT) with new (VALID) --> new, err=-ENOENT > case 5) no dentry exists: err (-ENOENT) with new (ERR) --> dentry, err=ERR > > trace_f2fs_lookup_end(dir, !IS_ERR_OR_NULL(new) ? new : dentry, > ino, IS_ERR(new) ? PTR_ERR(new) : err); Agreed, could you please add above description in commit message? Thanks, > > >> return new; >> out_iput: >> iput(inode); >> -- >> 2.35.3