From 35eca7d577e01ad5145fb454a64006a2a9eb5dcb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Attila=20=C3=81fra?= Date: Mon, 6 Aug 2007 15:48:37 +0300 Subject: [PATCH] mount: fix incorrect behavior when more than one fs type is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "mount" may fail when more than one file system type is specified, and the requested access mode is read/write, but the device is read-only. The error message is: "mount: wrong fs type, bad option, bad superblock on...". It works only if the correct file system type is the last item in the comma separated list. This is because when it tries to mount the file system again in read-only mode, the "types" parameter passed to the "try_mount_one" function contains only the last item instead of the entire list. For example, you cannot mount a UDF CD/DVD with "-t udf,iso9660" if you don't also add the read-only option. This means that some Linux distributions with the default configuration may not be able to mount UDF disks automatically (e.g. Ubuntu Dapper - Gutsy Tribe 3). Signed-off-by: Attila Áfra Signed-off-by: Karel Zak --- mount/mount.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mount/mount.c b/mount/mount.c index 6caea64a..d09fd5ef 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1279,10 +1279,9 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, bd, spec); break; } else { - if (loop) { - opts = opts0; - types = types0; - } + opts = opts0; + types = types0; + if (opts) { char *opts2 = append_opt(xstrdup(opts), "ro", NULL); my_free(opts1); -- 2.39.5