From: Chuck Ebbert <cebbert@redhat.com>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Roman Borisov <ext-roman.borisov@nokia.com>,
Alexander Shishkin <virtuoso@slind.org>
Subject: Re: 2.6.35-rc4: mount results with and without MS_SILENT differ
Date: Thu, 24 Mar 2011 23:47:11 -0400 [thread overview]
Message-ID: <20110324234711.60a6e3c3@katamari> (raw)
In-Reply-To: <201103140520.08737.vda.linux@googlemail.com>
On Mon, 14 Mar 2011 05:20:08 +0100
Denys Vlasenko <vda.linux@googlemail.com> wrote:
It looks like this bug has been there forever.
This fails:
> mount -vv --make-rshared mount.shared1 2>&1
This succeeds:
> mount -vv --loud --make-rshared mount.shared2 2>&1 # <-HERE
Failure case uses MS_REC | MS_SHARED | MS_SILENT
> mount: mount('','mount.shared1','',0x0010c000,''):0
It succeeds with MS_REC | MS_SHARED
> mount: mount('','mount.shared2','',0x00104000,''):0
Looking at do_mount() we see some flags get filtered out before checking
namespace flags:
flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | MS_BORN |
MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
MS_STRICTATIME);
Then:
else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
retval = do_change_type(&path, flags);
In do_change_type()
type = flags_to_propagation_type(flag);
if (!type)
return -EINVAL;
And flags_to_propagation_type() filters out MS_REC before making sure one
and only one of the propagation type flags is set:
int type = flags & ~MS_REC;
/* Fail if any non-propagation flags are set */
if (type & ~(MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
return 0;
/* Only one propagation flag should be set */
if (!is_power_of_2(type))
return 0;
Looks like the is_power_of_2() test is failing because MS_SILENT is set.
I'm not sure whether to filter MS_SILENT in the upper or lower function
though.
next prev parent reply other threads:[~2011-03-25 3:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 4:20 Denys Vlasenko
2011-03-25 3:47 ` Chuck Ebbert [this message]
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
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=20110324234711.60a6e3c3@katamari \
--to=cebbert@redhat.com \
--cc=ext-roman.borisov@nokia.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
Powered by JetHome