From owner-cvs-all Sun Mar 15 10:32:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA13211 for cvs-all-outgoing; Sun, 15 Mar 1998 10:32:53 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from helios.dnttm.ru (root@dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA13202 for ; Sun, 15 Mar 1998 10:32:48 -0800 (PST) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.8.5/8.8.5/IP-3) with UUCP id VAA31583; Sun, 15 Mar 1998 21:25:20 +0300 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.8.8/8.8.7) with ESMTP id VAA01396; Sun, 15 Mar 1998 21:35:05 +0300 (MSK) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199803151835.VAA01396@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Bruce Evans cc: mike@smith.net.au, committers@FreeBSD.ORG Subject: Re: dumb question about fstab and 226 beta In-reply-to: Your message of "Sun, 15 Mar 1998 22:58:30 +1100." <199803151158.WAA05923@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 15 Mar 1998 21:35:05 +0300 From: Dmitrij Tejblum Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Bruce Evans wrote: > The problem here is probably that the slice alias breaks fsck's `hotroot' > calculation in blockcheck(). After fsck finishes writing to the cdev > alias for a mounted bdev, the buffer cache is inconsistent. fsck fixes > this by remounting with flag MNT_RELOAD, but only if `hotroot' is set > correctly. You are right, of course. This trivial bogus patch fixes my test case. --- preen.c Sun Mar 15 19:10:09 1998 +++ preen.c Sun Mar 15 19:12:14 1998 @@ -98,6 +98,8 @@ if (preen == 0 || (passno == 1 && fsp->fs_passno == 1)) { if ((name = blockcheck(fsp->fs_spec)) != 0) { + if (strcmp(fsp->fs_file, "/") == 0) + hotroot++; if ((sumstatus = (*chkit)(name, fsp->fs_file, auxdata, 0)) != 0) return (sumstatus); (The remounting root probably harmless anyway) It is funny how various programs trust the root device in fstab, while true root device stored in kernel and cannot be changed while the system run. It is possible obtain the dev_t of root device via stat(2), so mount_ufs.c probably could test that the user-supplied device name match kernel's idea, and if not, determine correct device name with devname(3) :-|. (This way it should wait (in background) until devname(3) available. It also could upgrade root to read-write without device name). Such mount would be more tolerant to various user's mistake :-). I don't see similar way for fsck. Only "brute-force". Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message