Skip to content

Commit

Permalink
hostfs: Use correct mask for file mode
Browse files Browse the repository at this point in the history
S_IFMT is obviously wrong and needs to be 0777.
We're interested in the file mode, not the type.

Fixes: b98b910 (hostfs: No need to box and later unbox the file mode)
Reported-by: Markus Stenberg <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
richardweinberger committed May 4, 2015
1 parent 5ebe6af commit a718c92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
if (name == NULL)
goto out_put;

fd = file_create(name, mode & S_IFMT);
fd = file_create(name, mode & 0777);
if (fd < 0)
error = fd;
else
Expand Down

0 comments on commit a718c92

Please sign in to comment.