Date: Thu, 7 Feb 2008 10:20:02 GMT From: Jaakko Heinonen <jh@saunalahti.fi> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/120319: fsck on read-only root fs upgrades it to read-write Message-ID: <200802071020.m17AK2kg055639@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR kern/120319; it has been noted by GNATS.
From: Jaakko Heinonen <jh@saunalahti.fi>
To: bug-followup@FreeBSD.org, yar@comp.chem.msu.su
Cc:
Subject: Re: kern/120319: fsck on read-only root fs upgrades it to
read-write
Date: Thu, 7 Feb 2008 12:19:48 +0200
--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
This happens because the kernel doesn't set the "ro" mount option
initially for mounts in vfs_mountroot_try() (vfs_mount.c). ffs_mount()
remounts a file system as read-write if the "ro" option is missing.
Following patch adds the "ro" option for initial root mounts. It should
fix the problem. Could you verify that?
--
Jaakko
--KsGdsel6WgEHnImy
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="root-remount.diff"
Index: vfs_mount.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_mount.c,v
retrieving revision 1.273
diff -u -r1.273 vfs_mount.c
--- vfs_mount.c 24 Jan 2008 12:34:28 -0000 1.273
+++ vfs_mount.c 7 Feb 2008 07:33:00 -0000
@@ -1727,6 +1727,7 @@
"fstype", vfsname,
"fspath", "/",
"from", path,
+ "ro", NULL,
NULL);
if (error == 0) {
/*
@@ -2300,7 +2301,10 @@
if (cp == NULL)
break;
vp = va_arg(ap, const void *);
- ma = mount_arg(ma, cp, vp, -1);
+ if (vp == NULL)
+ ma = mount_arg(ma, cp, NULL, 0);
+ else
+ ma = mount_arg(ma, cp, vp, -1);
}
va_end(ap);
--KsGdsel6WgEHnImy--
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802071020.m17AK2kg055639>
