From: Jori Koolstra <jkoolstra@xs4all.nl>
To: Hongling Zeng <zenghongling@kylinos.cn>,
shaggy@kernel.org, hubcap@omnibond.com, martin@omnibond.com,
viro@zeniv.linux.org.uk, richard@nod.at, jlayton@kernel.org,
jack@suse.cz, brauner@kernel.org, neil@brown.name
Cc: jfs-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org, zhongling0719@126.com
Subject: Re: [PATCH] fs: Fix return in jfs_mkdir and orangefs_mkdir
Date: Fri, 1 May 2026 11:57:59 +0200 (CEST) [thread overview]
Message-ID: <427414013.2049436.1777629479250@kpc.webmail.kpnmail.nl> (raw)
In-Reply-To: <20260501071058.1243245-1-zenghongling@kylinos.cn>
> Op 01-05-2026 09:10 CEST schreef Hongling Zeng <zenghongling@kylinos.cn>:
>
>
> Return NULL instead of passing to ERR_PTR while err is zero
> Fixes these smatch warnings:
> - fs/jfs/namei.c:311 jfs_mkdir() warn: passing zero to 'ERR_PTR'
> - fs/orangefs/namei.c:369 orangefs_mkdir() warn: passing zero
> to 'ERR_PTR'
>
> Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *")
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
> fs/jfs/namei.c | 2 +-
> fs/orangefs/namei.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
> index 60c4a0e0fca5..442d62679262 100644
> --- a/fs/jfs/namei.c
> +++ b/fs/jfs/namei.c
> @@ -309,7 +309,7 @@ static struct dentry *jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip,
> out1:
>
> jfs_info("jfs_mkdir: rc:%d", rc);
> - return ERR_PTR(rc);
> + return rc ? ERR_PTR(rc) : NULL;
> }
>
> /*
> diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
> index bec5475de094..75e65e72c2d6 100644
> --- a/fs/orangefs/namei.c
> +++ b/fs/orangefs/namei.c
> @@ -362,7 +362,7 @@ static struct dentry *orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
> __orangefs_setattr(dir, &iattr);
> out:
> op_release(new_op);
> - return ERR_PTR(ret);
> + return ret ? ERR_PTR(ret) : NULL;
> }
>
> static int orangefs_rename(struct mnt_idmap *idmap,
> --
> 2.25.1
Sure. Feel free to add:
Reviewed-by: Jori Koolstra <jkoolstra@xs4all.nl>
However, I will say jfs is kinda low priority, so maybe David will not pick it up.
next prev parent reply other threads:[~2026-05-01 9:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 7:10 Hongling Zeng
2026-05-01 9:57 ` Jori Koolstra [this message]
2026-05-11 9:30 ` Christian Brauner
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=427414013.2049436.1777629479250@kpc.webmail.kpnmail.nl \
--to=jkoolstra@xs4all.nl \
--cc=brauner@kernel.org \
--cc=hubcap@omnibond.com \
--cc=jack@suse.cz \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin@omnibond.com \
--cc=neil@brown.name \
--cc=richard@nod.at \
--cc=shaggy@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zenghongling@kylinos.cn \
--cc=zhongling0719@126.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®