]> Gentwo Git Trees - linux/.git/commit
do_move_mount(): use the parent mount returned by do_lock_mount()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Aug 2025 17:47:43 +0000 (13:47 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:26:05 +0000 (21:26 -0400)
commit842e12352c3074b8af1bc95cc2bb1e9fb47f4334
treeae92bca5695237057d2faf9b52f9c3f732c31d7b
parent2010464cfafb22821e39c216cb068d83c91d7d8b
do_move_mount(): use the parent mount returned by do_lock_mount()

After successful do_lock_mount() call, mp.parent is set to either
real_mount(path->mnt) (for !beneath case) or to ->mnt_parent of that
(for beneath).  p is set to real_mount(path->mnt) and after
several uses it's made equal to mp.parent.  All uses prior to that
care only about p->mnt_ns and since p->mnt_ns == parent->mnt_ns,
we might as well use mp.parent all along.

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