Re: 8.0-BETA4 panic: ffs_sync: rofs mod

From: Jaakko Heinonen <jh_at_saunalahti.fi>
Date: Mon, 14 Sep 2009 20:32:09 +0300
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)
_at__at_ -675,6 +675,19 _at__at_ 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
Received on Mon Sep 14 2009 - 15:32:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:55 UTC