Re: [PATCH v2 25/31] ramfs: drop redundant S_IFDIR from mkdir
From: Jan Kara
Date: Wed Jul 01 2026 - 06:12:06 EST
On Tue 30-06-26 12:53:54, Jori Koolstra wrote:
> vfs_mkdir() now sets the S_IFDIR type bit in the mode it passes to
> ->mkdir(), so OR-ing S_IFDIR into the mode again in ramfs_mkdir() is
> redundant. Drop it.
>
> Assisted-by: Claude Opus 4.8 (1M context)
> Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> fs/ramfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
> index 3987639ed132..e884ebc58a33 100644
> --- a/fs/ramfs/inode.c
> +++ b/fs/ramfs/inode.c
> @@ -121,7 +121,7 @@ ramfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
> static struct dentry *ramfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
> struct dentry *dentry, umode_t mode)
> {
> - int retval = ramfs_mknod(&nop_mnt_idmap, dir, dentry, mode | S_IFDIR, 0);
> + int retval = ramfs_mknod(&nop_mnt_idmap, dir, dentry, mode, 0);
> if (!retval)
> inc_nlink(dir);
> return ERR_PTR(retval);
> --
> 2.54.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR