mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] nilfs2: Fix return in nilfs_mkdir
@ 2026-05-20 10:15 Ryusuke Konishi
  2026-05-20 18:22 ` Viacheslav Dubeyko
  0 siblings, 1 reply; 2+ messages in thread
From: Ryusuke Konishi @ 2026-05-20 10:15 UTC (permalink / raw)
  To: Viacheslav Dubeyko; +Cc: linux-nilfs, LKML, Hongling Zeng

From: Hongling Zeng <zenghongling@kylinos.cn>

Return NULL instead of passing zero to ERR_PTR.
  Fixes smatch warning:
     - fs/nilfs2/namei.c:261 nilfs_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>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
---
Hi Viacheslav,

Please add this to the queue for the next cycle.

This is one of the fixes by Hongling Zeng, a patch that individually
corrects a semantic issue (which is harmless in execution) related to
the use of the ERR_PTR macro that arose from a recent VFS change.

Thanks,
Ryusuke Konishi

 fs/nilfs2/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 40ac679ec56e..e2fe95de3d71 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -258,7 +258,7 @@ static struct dentry *nilfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
 	else
 		nilfs_transaction_abort(dir->i_sb);
 
-	return ERR_PTR(err);
+	return err ? ERR_PTR(err) : NULL;
 
 out_fail:
 	drop_nlink(inode);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nilfs2: Fix return in nilfs_mkdir
  2026-05-20 10:15 [PATCH] nilfs2: Fix return in nilfs_mkdir Ryusuke Konishi
@ 2026-05-20 18:22 ` Viacheslav Dubeyko
  0 siblings, 0 replies; 2+ messages in thread
From: Viacheslav Dubeyko @ 2026-05-20 18:22 UTC (permalink / raw)
  To: Ryusuke Konishi, Viacheslav Dubeyko; +Cc: linux-nilfs, LKML, Hongling Zeng

On Wed, 2026-05-20 at 19:15 +0900, Ryusuke Konishi wrote:
> From: Hongling Zeng <zenghongling@kylinos.cn>
> 
> Return NULL instead of passing zero to ERR_PTR.
>   Fixes smatch warning:
>      - fs/nilfs2/namei.c:261 nilfs_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>
> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
> ---
> Hi Viacheslav,
> 
> Please add this to the queue for the next cycle.
> 
> This is one of the fixes by Hongling Zeng, a patch that individually
> corrects a semantic issue (which is harmless in execution) related to
> the use of the ERR_PTR macro that arose from a recent VFS change.
> 
> Thanks,
> Ryusuke Konishi
> 
>  fs/nilfs2/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
> index 40ac679ec56e..e2fe95de3d71 100644
> --- a/fs/nilfs2/namei.c
> +++ b/fs/nilfs2/namei.c
> @@ -258,7 +258,7 @@ static struct dentry *nilfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
>  	else
>  		nilfs_transaction_abort(dir->i_sb);
>  
> -	return ERR_PTR(err);
> +	return err ? ERR_PTR(err) : NULL;
>  
>  out_fail:
>  	drop_nlink(inode);

Applied.

Thanks,
Slava.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-20 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-20 10:15 [PATCH] nilfs2: Fix return in nilfs_mkdir Ryusuke Konishi
2026-05-20 18:22 ` Viacheslav Dubeyko

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®