linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hostfs: Use correct mask for file mode
@ 2015-05-04 12:53 Richard Weinberger
  2015-05-04 13:22 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2015-05-04 12:53 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: linux-kernel, markus.stenberg, Richard Weinberger

S_IFMT is obviously wrong and needs to be 0777.
We're interested in the file mode, not the type.

Fixes: b98b91029c (hostfs: No need to box and later unbox the file mode)
Reported-by: Markus Stenberg <markus.stenberg@iki.fi>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/hostfs/hostfs_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index ef26317..07d8d8f 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -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
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-04 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 12:53 [PATCH] hostfs: Use correct mask for file mode Richard Weinberger
2015-05-04 13:22 ` Geert Uytterhoeven
2015-05-04 13:25   ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).