Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Dec 1998 20:18:45 -0800
From:      Julian Elischer <julian@whistle.com>
To:        current@FreeBSD.ORG
Cc:        Kirk McKusick <mckusick@McKusick.COM>, Don Lewis <Don.Lewis@tsc.tdk.com>
Subject:   FreeBSD fsck updated
Message-ID:  <36661125.31DFF4F5@whistle.com>
References:  <199811230603.WAA02649@salsa.gv.tsc.tdk.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--------------7DE145182F1CF0FB237C228A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I have checked in kirk's newest fsck (well, a week or so old)

This understands soft updates a bit better, and has some improved
checks for orrupted filesystems and  a few fixes..
We have also incorporated soem FreeBSD fixes in kirk's sources.

What I have left are a few small patches (attached)
that I'm not sure about. Two appear to be fro support for
symlinks-in-inode denoted by a 0 block count. (I'm not sure about the
correctness of them) (when was it done that way? 386BSD?)

one is some extra pronouncements when some bits are found unset.

whether we merge these old freebsd bits into the current new
version is more a political matter..

What does everyone think? I now kirk doesn't like the 
noisy messages about the clean and modified bits..

julian

--------------7DE145182F1CF0FB237C228A
Content-Type: text/plain; charset=us-ascii; name="still2do.diffs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="still2do.diffs"


Is this the verboseness you were complaining about?


diff -cr fsck/pass5.c fsck.julian/pass5.c
*** fsck/pass5.c	Wed Dec  2 18:41:11 1998
--- fsck.julian/pass5.c	Wed Dec  2 16:26:18 1998
***************
*** 355,361 ****
  	    && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
  		memmove(&fs->fs_cstotal, &cstotal, sizeof *cs);
  		fs->fs_ronly = 0;
- 		fs->fs_fmod = 0;
  		sbdirty();
  	}
  }
--- 355,378 ----
  	    && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
  		memmove(&fs->fs_cstotal, &cstotal, sizeof *cs);
  		fs->fs_ronly = 0;
  		sbdirty();
+ 	}
+ 	if (fs->fs_fmod != 0) {
+ 		pwarn("MODIFIED FLAG SET IN SUPERBLOCK");
+ 		if (preen)
+ 			printf(" (FIXED)\n");
+ 		if (preen || reply("FIX") == 1) {
+ 			fs->fs_fmod = 0;
+ 			sbdirty();
+ 		}
+ 	}
+ 	if (fs->fs_clean == 0) {
+ 		pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK");
+ 		if (preen)
+ 			printf(" (FIXED)\n");
+ 		if (preen || reply("FIX") == 1) {
+ 			fs->fs_clean = 1;
+ 			sbdirty();
+ 		}
  	}
  }


Should a symbolic link with no blocks be treated differently?
Possibly this is supporting old hidden symlinks.

diff -cr fsck/inode.c fsck.don/inode.c
*** fsck/inode.c	Wed Dec  2 18:41:11 1998
--- fsck.don/inode.c	Wed Dec  2 17:17:32 1998
***************
*** 75,81 ****
  	idesc->id_filesize = dp->di_size;
  	mode = dp->di_mode & IFMT;
  	if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
! 	    dp->di_size < (unsigned)sblock.fs_maxsymlinklen))
  		return (KEEPON);
  	dino = *dp;
  	ndb = howmany(dino.di_size, sblock.fs_bsize);
--- 75,81 ----
  	idesc->id_filesize = dp->di_size;
  	mode = dp->di_mode & IFMT;
  	if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
! 	    (dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0)))
  		return (KEEPON);
  	dino = *dp;
  	ndb = howmany(dino.di_size, sblock.fs_bsize);

I guess this is also "old" symlink support..

diff -cr fsck/pass1.c fsck.don/pass1.c
*** fsck/pass1.c	Wed Dec  2 18:41:11 1998
--- fsck.don/pass1.c	Wed Dec  2 17:17:32 1998
***************
*** 241,247 ****
  		 * Fake ndb value so direct/indirect block checks below
  		 * will detect any garbage after symlink string.
  		 */
! 		if (dp->di_size < sblock.fs_maxsymlinklen) {
  			ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
  			if (ndb > NDADDR) {
  				j = ndb - NDADDR;
--- 241,248 ----
  		 * Fake ndb value so direct/indirect block checks below
  		 * will detect any garbage after symlink string.
  		 */
! 		if ((dp->di_size < sblock.fs_maxsymlinklen) ||
! 		    dp->di_blocks == 0) {
  			ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
  			if (ndb > NDADDR) {
  				j = ndb - NDADDR;


--------------7DE145182F1CF0FB237C228A--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36661125.31DFF4F5>