Hi Karel, Karel Zak <kzak@xxxxxxxxxx> writes: > Hi Matthias, > > On Thu, Nov 06, 2008 at 02:45:38PM +0100, Matthias Koenig wrote: >> Currently mounting an image fails if it is readonly. > > sorry, but I have a stupid question -- what do you mean with "readonly", > file (image) permissions or filesystem mode? Access permissions of the filesystem, but this is not really correct...see below. > >> set_loop checks only for EROFS to retry open with readonly mode, >> but in this case we get EACCES. > > I have a problem to reproduce this problem. Do you have any example? Hmm ok, after evaluating this again more carefully, there are no problems if it is a file on a local filesystem. It seems only to happen if it is a NFS mounted image, which is read-write in permission but with root_squash option. # cat /etc/exports /test *(async,rw,no_subtree_check,root_squash) # mount giuliani:/test on /test type nfs (rw,addr=10.10.4.24,nfsvers=3,proto=tcp,mountproto=udp) # ls -l /test/ total 10256 -rw-r--r-- 1 root root 10485760 2008-11-13 22:35 voltest # mount -oloop /test/voltest /mnt /test/voltest: Permission denied # strace -e open mount -oloop /test/voltest /mnt [...] open("/test/voltest", O_RDWR) = -1 EACCES (Permission denied) [...] But on a local file: # ls -l /tmp/vol.ext3 -r--r--r-- 1 root root 536870912 2008-04-14 12:27 /tmp/vol.ext3 # mount -oloop /tmp/vol.ext3 /mnt No problem here. Matthias -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html