Bug 1809124
Summary: | one iso can't mount to different files at the same time. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | 1014938109 |
Component: | util-linux | Assignee: | Karel Zak <kzak> |
Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 31 | CC: | jonathan, kzak |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-03-03 11:51:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
1014938109
2020-03-02 13:43:46 UTC
(In reply to 1014938109 from comment #0) > Description of problem: > I can't mount the same iso file to different mount point. > > Version-Release number of selected component (if applicable): > util-linux-2.35.1-1.fc32 > > How reproducible: > mount /home/test.iso /mnt > mount: /mnt: WARNING: device write-protected, mounted read-only. > mount /home/test.iso /home/test10 > mount: /test10: /dev/loop0 already mounted on /mnt. > > Steps to Reproduce: > 1.mount /home/test.iso /mnt > 2.mount /home/test.iso /home/test10 > 3. > > Actual results: > mount: /test10: /dev/loop0 already mounted on /mnt. > > Expected results: > mount successful. > > Additional info: I can do the mounting successful on centos7.5. The problem is that mount(8) uses "rw" mode to mount the filesystem by default. It is no problem for the first attempt as mount(8) able to detect that for iso kernel returns EACCES and then mount(8_ repeats the mount syscal with RDONLY flag: # strace -e mount mount Fedora-Workstation-Live-x86_64-31-1.9.iso /mnt/A mount("/dev/loop0", "/mnt/A", "iso9660", 0, NULL) = -1 EACCES (Permission denied) mount("/dev/loop0", "/mnt/A", "iso9660", MS_RDONLY, NULL) = 0 It is problem for the second attemp: # strace -e mount mount Fedora-Workstation-Live-x86_64-31-1.9.iso /mnt/B mount("/dev/loop0", "/mnt/B", "iso9660", 0, NULL) = -1 EBUSY (Device or resource busy) mount: /mnt/B: /dev/loop0 already mounted on /mnt/A. In this case, the kernel returns EBUSY, but mount(8) is not able to recover from this situation to repeat mount again with "ro"... I guess old kernels return also EACCES for the second attempt (you can try it), unfortunately, EBUSY makes more sense in this context. I'll try to improve mount(8) to correctly react to EBUSY in this context. There is a very simple workaround, just use "mount --read-only <img> <pointpoint>". Implemented in upstream commit: https://github.com/karelzak/util-linux/commit/11b916cdabd9f57a4cddf10fd743af2165930dcd Fedora package will be updated after upgrade to v2.36 (summer 2020 or so). Thanks for your report! (In reply to Karel Zak from comment #3) > Implemented in upstream commit: > https://github.com/karelzak/util-linux/commit/ > 11b916cdabd9f57a4cddf10fd743af2165930dcd > > Fedora package will be updated after upgrade to v2.36 (summer 2020 or so). > > Thanks for your report! Thank you for your excellent work. The problem has been fixed. I used these two commits. 11b916cdabd9f57a4cddf10fd743af2165930dcd acd229fc2afe0c402cca3b21e0490be71dec2725 |