From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 7 10:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D27C16A41B for ; Thu, 7 Feb 2008 10:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5C213C517 for ; Thu, 7 Feb 2008 10:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m17AK2Nd055640 for ; Thu, 7 Feb 2008 10:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m17AK2kg055639; Thu, 7 Feb 2008 10:20:02 GMT (envelope-from gnats) Date: Thu, 7 Feb 2008 10:20:02 GMT Message-Id: <200802071020.m17AK2kg055639@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: kern/120319: fsck on read-only root fs upgrades it to read-write X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 10:20:03 -0000 The following reply was made to PR kern/120319; it has been noted by GNATS. From: Jaakko Heinonen 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--