[PATCH] UFS option parsing

Matias Atria (matias@sas.upenn.edu)
Sat, 22 Sep 2001 00:22:33 -0400 (EDT)


Hi,

Today I accidentally typed "mount -t ufs -o ufstype,ro ..." and the kernel
(2.4.9) oopsed. The following trivial patch fixes it.

Cheers,
Matias.

--- 2.4.9/fs/ufs/super.c.orig Fri Sep 21 20:30:30 2001
+++ 2.4.9/fs/ufs/super.c Fri Sep 21 21:59:34 2001
@@ -264,6 +264,11 @@
if ((value = strchr (this_char, '=')) != NULL)
*value++ = 0;
if (!strcmp (this_char, "ufstype")) {
+ if (!value) {
+ printk ("UFS-fs: The `ufstype' option "
+ "requires an argument\n");
+ return 0;
+ }
ufs_clear_opt (*mount_options, UFSTYPE);
if (!strcmp (value, "old"))
ufs_set_opt (*mount_options, UFSTYPE_OLD);
@@ -287,6 +292,10 @@
}
}
else if (!strcmp (this_char, "onerror")) {
+ if (!value) {
+ printk ("UFS-fs: No `onerror' action specified\n");
+ return 0;
+ }
ufs_clear_opt (*mount_options, ONERROR);
if (!strcmp (value, "panic"))
ufs_set_opt (*mount_options, ONERROR_PANIC);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/