]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mount: Handle EROFS before calling mount() syscall
authorStanislav Brabec <sbrabec@suse.cz>
Tue, 12 Apr 2016 18:23:25 +0000 (20:23 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 22 Apr 2016 10:50:14 +0000 (12:50 +0200)
commitb2c2c42a8e77a8b2eff2735b03b9a91a19c5e091
tree787e7762c9431bd0f574bb1c3bedac447eaddaf9
parentbdf46c4df9aa9201afce6ae29f72268c54293bd7
mount: Handle EROFS before calling mount() syscall

If the loop device is already initialized read-only, the new code for loop
device reuse returns -EROFS. There is no solution of this situation. But mount
can behave in the same way, as it does for EROFS returned by mount syscall: Try
again in read-only mode.

Before:
mount: /mnt/2: mount failed: Read-only file system

After:
mount: /btrfs.img is used as read only loop, mounting read-only

Note: It would be nice to mention loop device name in the warning message, but
it is not available in the mount context.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
sys-utils/mount.c