From: Valerie Aurora <vaurora@redhat.com>
To: Bob Copeland <me@bobcopeland.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Karel Zak <kzak@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] VFS: Sanity check mount flags passed to change_mnt_propagation()
Date: Fri, 27 Aug 2010 14:12:05 -0400 [thread overview]
Message-ID: <20100827181205.GD26872@shell> (raw)
In-Reply-To: <AANLkTik-uXDtvA9G7sr1becN235PMzFWmuD5t9Xu4yZX@mail.gmail.com>
On Fri, Aug 27, 2010 at 01:51:06PM -0400, Bob Copeland wrote:
> On Fri, Aug 27, 2010 at 1:43 PM, Valerie Aurora <vaurora@redhat.com> wrote:
> > On Thu, Aug 26, 2010 at 07:14:36PM -0600, Matthew Wilcox wrote:
> >> Hrm. ?I think we can do this a bit more pithily.
> >>
> >> ? ? ? /* Only one propagation flag should be set, and no others */
> >> ? ? ? if (hweight32(type) != 1 &&
> >> ? ? ? ? ? (type & ~(MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
> >> ? ? ? ? ? ? ? return 0;
> >>
> >> Too clever?
> >
> > I was hoping someone would go find the best bitop for me, thanks. :)
> > hweight32() is an awkward name but the comment makes it clear. ?I'm
> > happy with either.
> >
> > Thanks for the help,
>
> Didn't read surrounding code, but is that supposed to be '||'?
>
> Otherwise the case where only a single non-propagation flag is
> set no longer returns 0...
Yes, thanks!
I'll run the test program again before resubmitting. :)
-VAL
next prev parent reply other threads:[~2010-08-27 18:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 20:03 [PATCH] VFS: Sanity check mount flags passed to change_mnt_propagation() Valerie Aurora
2010-08-27 1:14 ` Matthew Wilcox
2010-08-27 17:43 ` Valerie Aurora
2010-08-27 17:51 ` Bob Copeland
2010-08-27 18:12 ` Valerie Aurora [this message]
2010-08-28 10:57 ` Matthew Wilcox
2010-08-28 13:15 ` Bob Copeland
2010-08-28 21:23 ` Linus Torvalds
2010-08-30 18:26 ` Valerie Aurora
2010-08-27 10:36 ` Karel Zak
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=20100827181205.GD26872@shell \
--to=vaurora@redhat.com \
--cc=kzak@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=me@bobcopeland.com \
--cc=viro@zeniv.linux.org.uk \
/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).