From: Al Viro <viro@ZenIV.linux.org.uk>
To: Steve French <smfrench@gmail.com>
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
Jeff Layton <jlayton@redhat.com>,
Shirish Pargaonkar <shirishpargaonkar@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Fixing fmode_t warnings
Date: Tue, 18 Nov 2008 17:00:22 +0000 [thread overview]
Message-ID: <20081118170022.GT28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <524f69650811180841v135a3d15o702766c703b4be22@mail.gmail.com>
On Tue, Nov 18, 2008 at 10:41:17AM -0600, Steve French wrote:
> Do you think it is worthwhile fixing this "sparse" warning ? oflags
> is an int since the lookup intent open.flags is an int ...
>
> CHECK fs/cifs/dir.c
> fs/cifs/dir.c:169:16: warning: restricted fmode_t degrades to integer
> fs/cifs/dir.c:171:16: warning: restricted fmode_t degrades to integer
>
> int oflags = nd->intent.open.flags;
> desiredAccess = 0;
> (line 169) if (oflags & FMODE_READ)
> desiredAccess |= GENERIC_READ;
> (line 171) if (oflags & FMODE_WRITE) {
It's worse than that; open.flags *mixes* FMODE_... with O_...
The right solution is to get rid of the damn thing and pass struct file
with pre-fill ->f_mode to (split-off) variant of create.
next prev parent reply other threads:[~2008-11-18 17:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 16:41 Fixing fmode_t warnings Steve French
2008-11-18 16:49 ` Steve French
2008-11-18 17:00 ` Al Viro [this message]
2008-11-18 17:03 ` Jeff Layton
2008-11-18 17:12 ` Dave Kleikamp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081118170022.GT28946@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=shaggy@linux.vnet.ibm.com \
--cc=shirishpargaonkar@gmail.com \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.