Re: [PATCH v2 08/31] ext2: drop redundant S_IFDIR from mkdir

From: Jan Kara

Date: Wed Jul 01 2026 - 06:17:19 EST


On Tue 30-06-26 12:53:37, 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 ext2_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/ext2/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
> index 0d09d22fe708..411fd09c3c7e 100644
> --- a/fs/ext2/namei.c
> +++ b/fs/ext2/namei.c
> @@ -236,7 +236,7 @@ static struct dentry *ext2_mkdir(struct mnt_idmap * idmap,
>
> inode_inc_link_count(dir);
>
> - inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name);
> + inode = ext2_new_inode(dir, mode, &dentry->d_name);
> err = PTR_ERR(inode);
> if (IS_ERR(inode))
> goto out_dir;
> --
> 2.54.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR