Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp209462rwd; Fri, 26 May 2023 18:04:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FSkTbW+JUqtOKwowlOsQ+gKE769xQ5U1/QQV/a9cGXk6M7+KiZQ1ougKEqNbjSs/xlzaf X-Received: by 2002:a05:6a00:2e27:b0:64d:411b:3a0c with SMTP id fc39-20020a056a002e2700b0064d411b3a0cmr951278pfb.14.1685149463591; Fri, 26 May 2023 18:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685149463; cv=none; d=google.com; s=arc-20160816; b=Mofgqh/kpT5mEBzQoVeH88pZHysJLpVKSDqyD643yyU+JcKEUgMXZIhfZQEbhdmlPH wno2LZmLl3AAQGTyvNrSKUXmTX2fIn+zMiOSHIJ5JExTyQZ3DKTd0yiVr9Dr2FTL89/S fKAWw5qa00dwRbdFM1v2bLw7MR3m84z8wTh2KPuvraBxZoNyKz5qaAH1rFDe4jiP/MkL vSooOuSw03ppMpm9ahBkpIVrOyPqtIm/XOj8s97uzpJd2GJlTZyH1wsQttpHWqD5FnlZ Z6MquYjZHziFZFJwg4eXVzNn0Pu0102Inv9UBeHgpk0oKx1JRoNjvePV+2Kaf8yd3xGN 0QmA== 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=pzCwf7rCKewynPT6XgbF4RD3aVcQwi9kBDy4L/EFNqI=; b=OeE19245VzZClNpGRBz+QCTHIqxIkQHzx5kWoyvASwbH0yIV8UnKDZCQ2ZjL97w1Nt AUXvJJVYkKwIcHAHdjviM+ZE+JcuTlwNZ/6riq4bgh5Un3NuVNEYxyrkQ4BSUoX15Gwa d4YgaESo17JNIwu4H5yBHm/uIcvUdsGilDm39ZrCv/nKZ/4PpzqNM3bAv05AGJ64JY5Y qnAi0i9Mdb5gS69ZGwxcXjbo+LhKnNGeXGnZ9neWkpJhOcFL4D9W5x1DQ3cu2NMYEh2C hqIoBK6yXYEQwCMWWJxuGjmD3xE9pM6rQq8RE/4ogHeCWIxISjrEgLfuWrX1J0BsjV6b vtLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rftd8zu3; 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 w8-20020aa79a08000000b0064d5dd5adbfsi5330082pfj.292.2023.05.26.18.04.11; Fri, 26 May 2023 18:04:23 -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=rftd8zu3; 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 S230024AbjE0BBs (ORCPT + 99 others); Fri, 26 May 2023 21:01:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjE0BBr (ORCPT ); Fri, 26 May 2023 21:01:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B94FB135 for ; Fri, 26 May 2023 18:01:45 -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 55E5F61226 for ; Sat, 27 May 2023 01:01:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FC40C433D2; Sat, 27 May 2023 01:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685149304; bh=nag5934esDPVXTyIbFFm2NHW+4RouxV1DOgNY/Z5Oi8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=rftd8zu3MmsgHSfYm4E/Qwaqf6OlsnC3mIHgRpjPddRQc2xWF81G7s7+X6Ebb/qRw Nnpp61F7BF+R7PKHvl6Ri9pmvZSGVoPpjrvOP4Cl5jX4lyTKzXaXuMd+HNMN+z2AGU jBp3UTFIIe2+hbtHLk9EV8Xi4F4msJRsnVmB4EaTgXGtuxs1t3oBqjG8vLC8EDYCET T5VxpDf9LWzOZaubA+kx7Drt3R1uawePFV5jpP6TrS2qRqjFMoFoCM80RTlxZKKbOo u98XOgG2jzKsV+Y1meganojDSmAOjk6gw0WB29wOtfsVRlzoVfaK3hJETXTh5BGARd svFnJ0Mbl3erg== Message-ID: <2bb05623-9438-3b68-6ac8-4294f9676ff6@kernel.org> Date: Sat, 27 May 2023 09:01:41 +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 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: <20230524100812.80741-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=-4.5 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_MED,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/27 1:21, Jaegeuk Kim wrote: > On 05/24, Wu Bo wrote: >> The NULL return of 'd_splice_alias' dosen't mean error. >> >> Signed-off-by: Wu Bo >> --- >> fs/f2fs/namei.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c >> index 77a71276ecb1..e5a3e39ce90c 100644 >> --- a/fs/f2fs/namei.c >> +++ b/fs/f2fs/namei.c >> @@ -577,7 +577,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, >> #endif >> new = c(inode, dentry); >> err = PTR_ERR_OR_ZERO(new); >> - trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err); >> + trace_f2fs_lookup_end(dir, new ? new : dentry, ino, err); > > Shouldn't give an error pointer to the dentry field. > > How about just giving the err? > > - err = PTR_ERR_OR_ZERO(new); > - trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err); > + trace_f2fs_lookup_end(dir, dentry, ino, PTR_ERR_OR_ZERO(new)); static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) { if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; } For below two cases, PTR_ERR_OR_ZERO(new) will return zero: a) f2fs_lookup found existed dentry b) f2fs_lookup didn't find existed dentry (-ENOENT case) So in below commit, I passed -ENOENT to tracepoint for case b), so we can distinguish result of f2fs_lookup in tracepoint, actually, -ENOENT is expected value when we create a new file/directory. Commit 84597b1f9b05 ("f2fs: fix wrong value of tracepoint parameter") > > >> return new; >> out_iput: >> iput(inode); >> -- >> 2.35.3