Subject: Re: bin/1324: fsck's marking of root file system as clean doesn't stick
To: None <gnats-bugs@gnats.netbsd.org>
From: John Kohl <jtk@kolvir.arlington.ma.us>
List: netbsd-bugs
Date: 08/08/1995 23:54:52
Chris Demetriou pointed out that fsck(8) is supposed to try and remount
the root with MNT_UNLOAD, but it fails to do so.  Here's a patch to fix
that problem.  [If you have multiple file systems, the second and
successive calls to blockcheck() reset the "hotroot" variable so that
fsck erroneously believes the root FS is not hot, hence it doesn't try
to remount it.]

You should toss out the change to /etc/rc that I suggested, or at the
very least change it to "mount -o reload,ro -u /" (otherwise it gets
reloaded and the clean bit *stays on* while it's mounted)

==John

===================================================================
RCS file: RCS/preen.c,v
retrieving revision 1.1
diff -c -r1.1 sbin/fsck/preen.c
*** preen.c	1995/08/09 03:36:25	1.1
--- preen.c	1995/08/09 03:50:56
***************
*** 66,72 ****
  } *disks;
  
  int	nrun, ndisks;
! char	hotroot;
  
  char	*rawname(), *unrawname(), *blockcheck();
  void addpart __P((char *, char *, long));
--- 66,72 ----
  } *disks;
  
  int	nrun, ndisks;
! char	hotroot = 0;
  
  char	*rawname(), *unrawname(), *blockcheck();
  void addpart __P((char *, char *, long));
***************
*** 293,299 ****
  	char *newname, *raw;
  	int retried = 0;
  
- 	hotroot = 0;
  	if (stat("/", &stslash) < 0) {
  		perror("/");
  		printf("Can't stat root\n");
--- 293,298 ----