--bind-try fails when the source is a bind mounted deleted file
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c, linux
- Domain
- cli, operating-systems
Research direction
Start by reproducing the two shell examples with bwrap --bind-try and compare the successful first mount with the failed mount after deleting the source. Read the trimmed strace around openat2, file descriptors 5 and 4, and mount; done means the deleted bind-mounted file follows the expected ok1, ok2 behavior or the failure policy is clearly established.
Written by the indexing model from the issue text.
Description
touch a b
mount --bind a b
bwrap --bind-try b /x --ro-bind / / echo ok1
rm a
bwrap --bind-try b /x --ro-bind / / echo ok2
alternate example, without root:
touch a b; bwrap --bind / / --ro-bind $PWD/a $PWD/b sh -c 'bwrap --bind-try b /x --ro-bind / / echo ok1; rm a && bwrap --bind-try b /x --ro-bind / / echo ok2'
expected behavior: ok1, ok2
actual behavior: ok1, bwrap: Can't bind mount /tmp/x/b on /x: Unable to mount source on destination: No such file or directory
trimmed example strace output:
[pid 30523] openat(AT_FDCWD</>, "/oldroot", O_RDONLY|O_NOCTTY|O_CLOEXEC|O_PATH) = 4</oldroot>
[pid 30523] openat2(4</oldroot>, "/tmp/x/b", {flags=O_RDONLY|O_PATH, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_IN_ROOT}, 24) = 5</oldroot/tmp/x/b>(deleted)
[pid 30523] close(4</oldroot>) = 0
[pid 30523] fstat(5</oldroot/tmp/x/b>(deleted), {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid 30523] openat(AT_FDCWD</>, "/newroot", O_RDONLY|O_NOCTTY|O_CLOEXEC|O_PATH) = 4</newroot>
[pid 30523] openat2(4</newroot>, "/", {flags=O_RDONLY|O_DIRECTORY, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_IN_ROOT}, 24) = 6</newroot>
[pid 30523] close(4</newroot>) = 0
[pid 30523] openat(6</newroot>, "x", O_WRONLY|O_CREAT|O_EXCL|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC, 0444) = 4</newroot/x>
[pid 30523] close(4</newroot/x>) = 0
[pid 30523] openat(6</newroot>, "x", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 4</newroot/x>
[pid 30523] fstat(4</newroot/x>, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
[pid 30523] readlink("/proc/self/fd/4", "/newroot/x", 99) = 10
[pid 30523] mount("/proc/self/fd/5", "/proc/self/fd/4", NULL, MS_BIND|MS_REC|MS_SILENT, NULL) = -1 ENOENT (No such file or directory)
basically, the file exists in the sense that it can be opened and I/O performed, but cannot be bind-mounted from. unfortunately, it doesn't seem to be possible to work around with new mount API. I'm not sure whether it makes more sense to argue the case to kernel maintainers, or silently ignore this error in bubblewrap.
- Dominant language
- C
- Stars
- 8.9k
- Forks
- 391
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containers/bubblewrap
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
containers/bubblewrap#813 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
containers/bubblewrap#767 · 2 comments ·
Maintainers usually reply within 1 day
-
Related project comparisons in README.md are outdatedMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
containers/bubblewrap#743 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
containers/bubblewrap#298 · 4 comments · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
containers/bubblewrap#808 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in containers/bubblewrap
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openwrt/firmware-utils#82 ·
-
area:http-gateway good first issue priority:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
crazy-goat/php-fpm-ng#870 ·
Maintainers usually reply within 1 day
-
Discover carries headerEdges that nothing reads since #1914 moved E0507/E0517 to the compiler graphOpentech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
2个显示的问题Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
coolsnowwolf/lede#14209 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
polhenarejos/pico-hsm#147 ·