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

* Re: [PATCH] hostfs: Use correct mask for file mode
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2015-05-04 13:22 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: uml-devel, linux-kernel, markus.stenberg

On Mon, May 4, 2015 at 2:53 PM, Richard Weinberger <richard@nod.at> wrote:
> --- 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);

"(S_IRWXU | S_IRWXG | S_IRWXO)"?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] hostfs: Use correct mask for file mode
  2015-05-04 13:22 ` Geert Uytterhoeven
@ 2015-05-04 13:25   ` Richard Weinberger
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2015-05-04 13:25 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: uml-devel, linux-kernel, markus.stenberg

Am 04.05.2015 um 15:22 schrieb Geert Uytterhoeven:
> On Mon, May 4, 2015 at 2:53 PM, Richard Weinberger <richard@nod.at> wrote:
>> --- 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);
> 
> "(S_IRWXU | S_IRWXG | S_IRWXO)"?

I thought about that too but did not see a real benefit
as 0777 is well known and self describing.

Thanks,
//richard

^ permalink raw reply	[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).