]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
helper for mount rootwards traversal
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 26 Feb 2020 22:50:13 +0000 (17:50 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Apr 2020 05:09:21 +0000 (01:09 -0400)
commit7ef482fa65513b18eed05a5c5f00413aad137810
tree3e96c7120638e473ba1296121fe4257184851ecd
parent165200d6cb88a3cc1fdeb12e11e97fb96bf685d9
helper for mount rootwards traversal

The loops in follow_dotdot{_rcu()} are doing the same thing:
we have a mount and we want to find out how far up the chain
of mounts do we need to go.

We follow the chain of mount until we find one that is not
directly overmounting the root of another mount.  If such
a mount is found, we want the location it's mounted upon.
If we run out of chain (i.e. get to a mount that is not
mounted on anything else) or run into process' root, we
report failure.

On success, we want (in RCU case) d_seq of resulting location
sampled or (in non-RCU case) references to that location
acquired.

This commit introduces such primitive for RCU case and
switches follow_dotdot_rcu() to it; non-RCU case will be
go in the next commit.

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