Commits
Pavel Tikhomirov authored 3e055bfbc25
mount-v2: add resolve_mnt_fd helper This one is doing almost the same as resolve_mnt_path_fd, but it is a bit more tricky. The resolve_mnt_path_fd opens any path for the mount tree where we know mp_fd_id and mnt_fd_id for each mount, but resolve_mnt_fd wants to open mnt_fd_id for currently mounted mount, and thus we surely don't have it already =). We wan't to find root dentry of curently mounted mount M. If our parent P mount has same mountpoint with us we can't open M's root dentry from it. So we look for a first ancestor A with different mountpoint and open M's root dentry from A similar to resolve_mnt_path_fd, but skiping all ancestors with same mountpoint. There is one another case: M can be mounted on "/", and we don't have any ancestor with different mountpoint. And we have only super hacky way to open new mounts root, so lets not support it at all. More over there are other places which don't support it. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>