All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Wu Bo <bo.wu@vivo.com>
Cc: wubo.oduw@gmail.com, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/1] f2fs: fix args passed to trace_f2fs_lookup_end
Date: Fri, 26 May 2023 10:21:11 -0700	[thread overview]
Message-ID: <ZHDqhy4E9iSnneLa@google.com> (raw)
In-Reply-To: <20230524100812.80741-1-bo.wu@vivo.com>

On 05/24, Wu Bo wrote:
> The NULL return of 'd_splice_alias' dosen't mean error.
> 
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
>  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 = d_splice_alias(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));


>  	return new;
>  out_iput:
>  	iput(inode);
> -- 
> 2.35.3


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Wu Bo <bo.wu@vivo.com>
Cc: Chao Yu <chao@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, wubo.oduw@gmail.com
Subject: Re: [PATCH 1/1] f2fs: fix args passed to trace_f2fs_lookup_end
Date: Fri, 26 May 2023 10:21:11 -0700	[thread overview]
Message-ID: <ZHDqhy4E9iSnneLa@google.com> (raw)
In-Reply-To: <20230524100812.80741-1-bo.wu@vivo.com>

On 05/24, Wu Bo wrote:
> The NULL return of 'd_splice_alias' dosen't mean error.
> 
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
>  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 = d_splice_alias(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));


>  	return new;
>  out_iput:
>  	iput(inode);
> -- 
> 2.35.3

  reply	other threads:[~2023-05-26 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 10:08 [f2fs-dev] [PATCH 1/1] f2fs: fix args passed to trace_f2fs_lookup_end Wu Bo via Linux-f2fs-devel
2023-05-24 10:08 ` Wu Bo
2023-05-26 17:21 ` Jaegeuk Kim [this message]
2023-05-26 17:21   ` Jaegeuk Kim
2023-05-27  1:01   ` [f2fs-dev] " Chao Yu
2023-05-27  1:01     ` Chao Yu
2023-05-29  4:13     ` [f2fs-dev] " Wu Bo via Linux-f2fs-devel
2023-05-29  4:13       ` Wu Bo
2023-05-29 10:18       ` Chao Yu
2023-05-29 10:18         ` Chao Yu
2023-05-29 12:41         ` Wu Bo
2023-05-29 12:41           ` Wu Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZHDqhy4E9iSnneLa@google.com \
    --to=jaegeuk@kernel.org \
    --cc=bo.wu@vivo.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wubo.oduw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.