[PATCH] mount: fix incorrect behavior when more than one fs type is specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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).

The solution:

--- mount/mount.c.orig	2007-08-06 10:30:13.000000000 +0300
+++ mount/mount.c	2007-08-06 10:47:48.000000000 +0300
@@ -1279,10 +1279,9 @@
 		 bd, spec);
 	  break;
       } else {
-	 if (loop) {
+	 if (loop)
 	     opts = opts0;
-	     types = types0;
-	 }
+	 types = types0;
          if (opts) {
 	     char *opts2 = append_opt(xstrdup(opts), "ro", NULL);
 	     my_free(opts1);
-
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

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux