All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Bob Copeland <me@bobcopeland.com>
Cc: Valerie Aurora <vaurora@redhat.com>,
	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: Sat, 28 Aug 2010 04:57:07 -0600	[thread overview]
Message-ID: <20100828105707.GD3521@parisc-linux.org> (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...

Val's original code returned 0 as failure.  So a single non-propagation
flag set shouldn't return 0.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2010-08-28 10:57 UTC|newest]

Thread overview: 11+ 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 17:51       ` Bob Copeland
2010-08-27 18:12       ` Valerie Aurora
2010-08-28 10:57       ` Matthew Wilcox [this message]
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=20100828105707.GD3521@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=kzak@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@bobcopeland.com \
    --cc=vaurora@redhat.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 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.