From: "J. Bruce Fields" <bfields@fieldses.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Albert Fluegel <af@muc.de>, linux-nfs@vger.kernel.org
Subject: Re: Bugs / Patch in nfsd
Date: Mon, 18 Nov 2013 12:01:32 -0500 [thread overview]
Message-ID: <20131118170132.GD3203@fieldses.org> (raw)
In-Reply-To: <20131118130026.GA4153@infradead.org>
On Mon, Nov 18, 2013 at 05:00:26AM -0800, Christoph Hellwig wrote:
> On Mon, Nov 18, 2013 at 01:44:06PM +0100, Albert Fluegel wrote:
> > *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
> > - *p++ = htonl((u32) stat->mode);
> > + *p++ = htonl((u32) (stat->mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX)));
>
> Should be S_IALLUGO instead of manually repeating the flags. While this
> is a good practice and I'm in favour of it, I'd love to know what other
> value you see in the mode field. Do you have a wireshark dump or a
> trace?
Just tracing a v3 mount I can confirm that S_IFDIR (0x4000, 040000)
gets set in GETATTR replies.
Which definitely looks wrong. But we've been doing this forever (as far
as I can see nfs3xdr.c got added in 2.1.32, and the code was the same
way there), so I wonder if there's any undocumented lore about use of
these high bits.
Also if a client's actually behaving differently depending on how those
high bits are set, that might be worth reporting to the client
implementers, as it may represent an unintentional failure to sanitize
the returned bits.
Anyway, absent objections my default is to queue this up for 3.14 (using
S_IALLUGO).
--b.
next prev parent reply other threads:[~2013-11-18 17:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 12:44 Bugs / Patch in nfsd Albert Fluegel
2013-11-18 13:00 ` Christoph Hellwig
2013-11-18 17:01 ` J. Bruce Fields [this message]
2013-11-18 17:23 ` Christoph Hellwig
2013-11-18 17:37 ` J. Bruce Fields
2013-11-18 17:47 ` Christoph Hellwig
2013-11-20 16:28 ` Albert Fluegel
2013-11-20 16:45 ` J. Bruce Fields
2013-11-18 17:28 ` J. Bruce Fields
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=20131118170132.GD3203@fieldses.org \
--to=bfields@fieldses.org \
--cc=af@muc.de \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
/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 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).