linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Borisov <ext-roman.borisov@nokia.com>
To: viro@zeniv.linux.org.uk
Cc: Roman Borisov <ext-roman.borisov@nokia.com>,
	linux-kernel@vger.kernel.org, vda.linux@googlemail.com,
	cebbert@redhat.com, virtuoso@slind.org
Subject: Re: [PATCH] fs: bound mount propagation fix
Date: Tue, 12 Apr 2011 14:28:28 +0400	[thread overview]
Message-ID: <4DA4294C.2020609@nokia.com> (raw)
In-Reply-To: <7b9aa806294aadd47704d56ae3e7c757bf0ce6db.1301667509.git.ext-roman.borisov@nokia.com>

On 04/01/2011 06:48 PM, Roman Borisov wrote:
> I think MS_SILENT shouldn't be cleared anywhere. I suppose the bug is in
> MS_SHARED options checking. Please see the patch below.
>
> Fixed MS_SHARED, MS_SLAVE, MS_UNBINDABLE option handling;
> Existing options check doesn't allow to have any options combinations
> because of integer comparison (not bitwise).
>
> Signed-off-by: Roman Borisov<ext-roman.borisov@nokia.com>
> ---
>   fs/namespace.c |    2 +-
>   fs/pnode.c     |    6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 2beb0fb..e0cf263 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -1434,7 +1434,7 @@ static int do_change_type(struct path *path, int flag)
>   		return -EINVAL;
>
>   	down_write(&namespace_sem);
> -	if (type == MS_SHARED) {
> +	if (type&  MS_SHARED) {
>   		err = invent_group_ids(mnt, recurse);
>   		if (err)
>   			goto out_unlock;
> diff --git a/fs/pnode.c b/fs/pnode.c
> index 8d5f392..0c9dc54 100644
> --- a/fs/pnode.c
> +++ b/fs/pnode.c
> @@ -128,15 +128,15 @@ static int do_make_slave(struct vfsmount *mnt)
>
>   void change_mnt_propagation(struct vfsmount *mnt, int type)
>   {
> -	if (type == MS_SHARED) {
> +	if (type&  MS_SHARED) {
>   		set_mnt_shared(mnt);
>   		return;
>   	}
>   	do_make_slave(mnt);
> -	if (type != MS_SLAVE) {
> +	if (!(type&  MS_SLAVE)) {
>   		list_del_init(&mnt->mnt_slave);
>   		mnt->mnt_master = NULL;
> -		if (type == MS_UNBINDABLE)
> +		if (type&  MS_UNBINDABLE)
>   			mnt->mnt_flags |= MNT_UNBINDABLE;
>   		else
>   			mnt->mnt_flags&= ~MNT_UNBINDABLE;

Al could you comment please on which of the two approaches you prefer: 
mine or previously Denis's

--
Roman

  reply	other threads:[~2011-04-12 10:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  4:20 2.6.35-rc4: mount results with and without MS_SILENT differ Denys Vlasenko
2011-03-25  3:47 ` Chuck Ebbert
2011-03-26 21:43   ` Denys Vlasenko
2011-04-01 14:48     ` [PATCH] fs: bound mount propagation fix Roman Borisov
2011-04-12 10:28       ` Roman Borisov [this message]
2011-04-19 21:04       ` Andrew Morton
2011-04-20 11:51         ` Roman Borisov
     [not found] <cover.1303304011.git.ext-roman.borisov@nokia.com>
2011-04-20 14:11 ` [PATCH v2] " Roman Borisov
2011-04-21 20:04   ` [PATCH v3] " Andrew Morton
2011-04-22  9:02     ` Roman Borisov
2011-04-22 11:05     ` [PATCH v4] fs: namespacec " Roman Borisov

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=4DA4294C.2020609@nokia.com \
    --to=ext-roman.borisov@nokia.com \
    --cc=cebbert@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vda.linux@googlemail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=virtuoso@slind.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).