From: Karel Zak Date: Fri, 20 Mar 2015 11:42:33 +0000 (+0100) Subject: mount: don't remount read-only on --bind X-Git-Tag: v2.27-rc1~333 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b5b94685b7f91c61ff1abeaa8e7089226d2bf35;p=thirdparty%2Futil-linux.git mount: don't remount read-only on --bind mount(8) tries to mount read-only when the previous attempt ends with EROFS or EACCES. This is bad idea for bind mounts as "ro,bind" has a special semantic. Signed-off-by: Karel Zak --- diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 141098548d..c650efef2d 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -611,6 +611,9 @@ try_readonly: else if (mflags & MS_REMOUNT) warnx(_("cannot remount %s read-write, is write-protected"), src); + else if (mflags & MS_BIND) + warn(_("mount %s on %s failed"), src, tgt); + else { warnx(_("%s is write-protected, mounting read-only"), src);