From: Al Viro <viro@ZenIV.linux.org.uk>
To: Maxim Patlasov <mpatlasov@virtuozzo.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
devel@openvz.org
Subject: Re: [PATCH] fs/pnode.c: treat zero mnt_group_id-s as unequal
Date: Tue, 16 Feb 2016 19:54:23 +0000 [thread overview]
Message-ID: <20160216195423.GC17997@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20160216194527.9291.54622.stgit@maxim-thinkpad>
On Tue, Feb 16, 2016 at 11:45:33AM -0800, Maxim Patlasov wrote:
> propagate_one(m) calculates "type" argument for copy_tree() like this:
>
> > if (m->mnt_group_id == last_dest->mnt_group_id) {
> > type = CL_MAKE_SHARED;
> > } else {
> > type = CL_SLAVE;
> > if (IS_MNT_SHARED(m))
> > type |= CL_MAKE_SHARED;
> > }
>
> The "type" argument then governs clone_mnt() behavior with respect to flags
> and mnt_master of new mount. When we iterate through a slave group, it is
> possible that both current "m" and "last_dest" are not shared (although,
> both are slaves, i.e. have non-NULL mnt_master-s). Then the comparison
> above erroneously makes new mount shared and sets its mnt_master to
> last_source->mnt_master. The patch fixes the problem by handling zero
> mnt_group_id-s as though they are unequal.
>
> The similar problem exists in the implementation of "else" clause above
> when we have to ascend upward in the master/slave tree by calling:
>
> > last_source = last_source->mnt_master;
> > last_dest = last_source->mnt_parent;
>
> proper number of times. The last step is governed by
> "n->mnt_group_id != last_dest->mnt_group_id" condition that may lie if
> both are zero. The patch fixes this case in the same way as the former one.
Mind putting together a reproducer?
next prev parent reply other threads:[~2016-02-16 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 19:45 [PATCH] fs/pnode.c: treat zero mnt_group_id-s as unequal Maxim Patlasov
2016-02-16 19:54 ` Al Viro [this message]
2016-02-17 7:07 ` Maxim Patlasov
2016-02-26 0:26 ` [Devel] " Andrew Vagin
2016-02-16 22:58 ` Andrew Vagin
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=20160216195423.GC17997@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=devel@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatlasov@virtuozzo.com \
/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).