Re: [PATCH v2 22/31] ocfs2: dlmfs: drop redundant S_IFDIR from mkdir
From: Jan Kara
Date: Wed Jul 01 2026 - 06:21:34 EST
On Tue 30-06-26 12:53:51, 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 dlmfs_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/ocfs2/dlmfs/dlmfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
> index 5821e33df78f..dc538fd8d9f8 100644
> --- a/fs/ocfs2/dlmfs/dlmfs.c
> +++ b/fs/ocfs2/dlmfs/dlmfs.c
> @@ -422,7 +422,7 @@ static struct dentry *dlmfs_mkdir(struct mnt_idmap * idmap,
> goto bail;
> }
>
> - inode = dlmfs_get_inode(dir, dentry, mode | S_IFDIR);
> + inode = dlmfs_get_inode(dir, dentry, mode);
> if (!inode) {
> status = -ENOMEM;
> mlog_errno(status);
> --
> 2.54.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR