Skip to content

Commit

Permalink
omfs: fix (mode & S_IFDIR) abuse
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Al Viro committed Jul 26, 2011
1 parent 569254b commit 41c9648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/omfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int omfs_make_empty(struct inode *inode, struct super_block *sb)

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

if (inode->i_mode & S_IFDIR) {
if (S_ISDIR(inode->i_mode)) {
memset(&bh->b_data[OMFS_DIR_START], 0xff,
sbi->s_sys_blocksize - OMFS_DIR_START);
} else
Expand Down

0 comments on commit 41c9648

Please sign in to comment.