[lkml]   [2018]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]
Alan Jenkins <> wrote:

> It sounds like you're under-estimating how we can use mnt_ns->seq (as is
> currently used in mnt_ns_loop()).  Or maybe I am over-estimating it :).

I don't see how it helps. The duplication and attachment of the nsfs object
is already done by open_tree(), but as it's a detached tree, there are no
namespace assignments on the objects therein. move_mount() is attaching the
subtree as a whole.

I modified my example to put everything under /a, setting up initially on /a/x
and then moving to /a/y within the namespace. Then I made it print the mount
tree in more places. So after setup, I see:

[root@andromeda x]# findmnt -R /a
/a none
\_/a/x none
\_/a/x/private_mnt xxx
\_/a/x/private_mnt/child_ns nsfs[mnt:[4026532272]]

this looks fine. Then I do:

~/open_tree 3</a/x/private_mnt 3 \
nsenter --mount=/a/x/private_mnt/child_ns \
sh -c 'findmnt -R /a; ~/move_mount 4</a/y; findmnt -R /a'

and I see:

/a none
\_/a/x none
\_/a/x/private_mnt xxx
/a none
|_/a/x none
| \_/a/x/private_mnt xxx
\_/a/y xxx
\_/a/y/child_ns nsfs[mnt:[4026532272]]

in which /a/x/private_mnt got cloned and the clone mounted on "/a/y".

So, you're right, it's nothing to do with propagation. But I'm not sure how I
check this. Reject it in move_mount() if there's an nsfs? I'm not sure if
the seq number is actually useful here.


 \ /
  Last update: 2018-10-11 15:11    [W:0.232 / U:2.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site