Date: Sun, 15 Mar 1998 21:35:05 +0300 From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> To: Bruce Evans <bde@zeta.org.au> Cc: mike@smith.net.au, committers@FreeBSD.ORG Subject: Re: dumb question about fstab and 226 beta Message-ID: <199803151835.VAA01396@tejblum.dnttm.rssi.ru> In-Reply-To: Your message of "Sun, 15 Mar 1998 22:58:30 %2B1100." <199803151158.WAA05923@godzilla.zeta.org.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803151835.VAA01396>