New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated cherry pick of #110973: Make sure auto-mounted subpath mount source is already #112499
Automated cherry pick of #110973: Make sure auto-mounted subpath mount source is already #112499
Conversation
For example, we have two filesystems, one is embedded into another: /a/test # first filesystem with a directory "/a/test/b2" /a/test/b2 # not auto mounted yet second filesystem, notice "/a/test/b2" is # a new directory on this filesystem after this filesystem is mounted For subpath mount "/a/test/b2", `openat("/a/test", "b2")` gets directory "b2" on the first filesystem, then "mount -c" will use this wrong directory as source directory. `fstatat("/a/test", "b2/")` forces triggering auto mount of second filesystem, so `openat("/a/test", "b2")` gets correct source directory for "mount -c". This fixes issue kubernetes#110818 (comment) References: 1. https://man7.org/linux/man-pages/man2/openat.2.html If pathname refers to an automount point that has not yet been triggered, so no other filesystem is mounted on it, then the call returns a file descriptor referring to the automount directory without triggering a mount. 2. https://man7.org/linux/man-pages/man2/open_by_handle_at.2.html name_to_handle_at() does not trigger a mount when the final component of the pathname is an automount point. When a filesystem supports both file handles and automount points, a name_to_handle_at() call on an automount point will return with error EOVERFLOW without having increased handle_bytes. This can happen since Linux 4.13 with NFS when accessing a directory which is on a separate filesystem on the server. In this case, the automount can be triggered by adding a "/" to the end of the pathname.
/kind bug |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/retest-required |
Cherry pick of #110973 on release-1.23.
#110973: Make sure auto-mounted subpath mount source is already
For details on the cherry pick process, see the cherry pick requests page.
Does this PR introduce a user-facing change?