[PATCH v2 08/31] ext2: drop redundant S_IFDIR from mkdir
From: Jori Koolstra
Date: Tue Jun 30 2026 - 06:59:26 EST
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>
---
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