pivot_root(): reorder tree surgeries, collapse unhash_mnt() and put_mountpoint()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Apr 2025 20:53:01 +0000 (16:53 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jun 2025 22:13:42 +0000 (18:13 -0400)
commite30da2a20e31ab958d41e5a2c764968d95f17b61
tree8f8bb9b880ce1b1b0eb4892b310a5fe8d1a05425
parentec3265a245b22f8b8a0b20e04dd1d3f4f4a9ce09
pivot_root(): reorder tree surgeries, collapse unhash_mnt() and put_mountpoint()

attach new_mnt *before* detaching root_mnt; that way we don't need to keep hold
on the mountpoint and one more pair of unhash_mnt()/put_mountpoint() gets
folded together into umount_mnt().

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