8.0-BETA4 panic: ffs_sync: rofs mod

Jaakko Heinonen jh at saunalahti.fi
Mon Sep 14 17:32:16 UTC 2009


On 2009-09-14, Mel Flynn wrote:
> > The most obvious problem seems to be that both "ro" and "rw" options are
> > allowed to enter to mount point options concurrently.
> 
> Why does mountd(8) call nmount with update?

It uses nmount(2) to update NFS exports.

> As I read the above, any command line overrides done through
> umount/mount will be negated by having mountd running. That's a bit
> surprising.

Calling nmount() with "update" and "export" string options shouldn't
affect to any other options in any way. The problem is that the mount
point has both "ro" and "rw" options active before mountd calls
nmount(). Because of the "ro" option FFS mount code changes the file
system to read-only. The FFS code looks for "ro" string option only when
doing mount updates.

Here's a workaround patch for the problem. This is by no means a
complete fix for nmount(2) problems with negated mount options (i.e.
options prefixed with "no").

%%%
Index: sys/kern/vfs_mount.c
===================================================================
--- sys/kern/vfs_mount.c	(revision 197085)
+++ sys/kern/vfs_mount.c	(working copy)
@@ -675,6 +675,19 @@ vfs_donmount(struct thread *td, int fsfl
 	}
 
 	/*
+	 * XXX: Delete conflicting read-write/read-only string options.
+	 */
+	if (fsflags & MNT_RDONLY) {
+		vfs_deleteopt(optlist, "noro");
+		vfs_deleteopt(optlist, "rw");
+		has_noro = 0;
+		has_rw = 0;
+	} else {
+		vfs_deleteopt(optlist, "ro");
+		vfs_deleteopt(optlist, "norw");
+	}
+
+	/*
 	 * If "rw" was specified as a mount option, and we
 	 * are trying to update a mount-point from "ro" to "rw",
 	 * we need a mount option "noro", since in vfs_mergeopts(),
%%%

-- 
Jaakko


More information about the freebsd-current mailing list