copy_mnt_ns(): handle a corner case (overmounted mntns bindings) saner
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Nov 2022 03:55:57 +0000 (22:55 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Nov 2022 03:55:57 +0000 (22:55 -0500)
commit61d8e42667716f71f2c26e327e66f2940d809f80
tree6d4e523e378c75ac20c30127ee6444cf1e78c198
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
copy_mnt_ns(): handle a corner case (overmounted mntns bindings) saner

copy_mnt_ns() has the old tree copied, with mntns binding *and* anything
bound on top of them skipped.  Then it proceeds to walk both trees in
parallel.  Unfortunately, it doesn't get the "skip the stuff we'd skipped
when copying" quite right.  Consequences are minor (the ->mnt_root
comparison will return the situation to sanity pretty soon and the worst
we get is the unexpected subset of opened non-directories being switched
to new namespace), but it's confusing enough and it's not hard to get
the expected behaviour...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c