Skip to content

Commit 41c9648

Browse files
author
Al Viro
committed
omfs: fix (mode & S_IFDIR) abuse
granted, on a filesystem that has only regular files and directories it happens to work, but really should be S_ISDIR(mode)... Signed-off-by: Al Viro <[email protected]>
1 parent 569254b commit 41c9648

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/omfs/dir.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int omfs_make_empty(struct inode *inode, struct super_block *sb)
9393

9494
memset(bh->b_data, 0, sizeof(struct omfs_inode));
9595

96-
if (inode->i_mode & S_IFDIR) {
96+
if (S_ISDIR(inode->i_mode)) {
9797
memset(&bh->b_data[OMFS_DIR_START], 0xff,
9898
sbi->s_sys_blocksize - OMFS_DIR_START);
9999
} else

0 commit comments

Comments
 (0)