From 0826920c54e7605a2c1e3cbdc37a47119fcd6cd4 Mon Sep 17 00:00:00 2001 From: mycroft Date: Wed, 28 Dec 1994 00:03:49 +0000 Subject: [PATCH] Mostly sync with CSRG. --- sbin/fsck/dir.c | 6 +++--- sbin/fsck/fsck.8 | 12 ++++++++---- sbin/fsck/pass2.c | 32 ++++++++++++++++++++++---------- sbin/fsck/pass5.c | 10 +++++----- sbin/fsck/preen.c | 36 ++++++++++++++++++++---------------- sbin/fsck/setup.c | 21 ++++++++++++++++++--- sbin/fsck_ffs/dir.c | 6 +++--- sbin/fsck_ffs/fsck_ffs.8 | 12 ++++++++---- sbin/fsck_ffs/pass2.c | 32 ++++++++++++++++++++++---------- sbin/fsck_ffs/pass5.c | 10 +++++----- sbin/fsck_ffs/preen.c | 36 ++++++++++++++++++++---------------- sbin/fsck_ffs/setup.c | 21 ++++++++++++++++++--- 12 files changed, 152 insertions(+), 82 deletions(-) diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c index 1a0e17ffc10c..ce0a44aa44d8 100644 --- a/sbin/fsck/dir.c +++ b/sbin/fsck/dir.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)dir.c 8.1 (Berkeley) 6/5/93";*/ -static char *rcsid = "$Id: dir.c,v 1.15 1994/12/05 20:15:44 cgd Exp $"; +/*static char sccsid[] = "from: @(#)dir.c 8.5 (Berkeley) 12/8/94";*/ +static char *rcsid = "$Id: dir.c,v 1.16 1994/12/28 00:03:49 mycroft Exp $"; #endif /* not lint */ #include @@ -348,11 +348,11 @@ mkentry(idesc) dirp->d_reclen = oldlen; dirp = (struct direct *)(((char *)dirp) + oldlen); dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */ + dirp->d_reclen = newent.d_reclen; if (newinofmt) dirp->d_type = typemap[idesc->id_parent]; else dirp->d_type = 0; - dirp->d_reclen = newent.d_reclen; dirp->d_namlen = newent.d_namlen; memcpy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1); # if (BYTE_ORDER == LITTLE_ENDIAN) diff --git a/sbin/fsck/fsck.8 b/sbin/fsck/fsck.8 index e9f6c119a047..29005090bbba 100644 --- a/sbin/fsck/fsck.8 +++ b/sbin/fsck/fsck.8 @@ -29,10 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)fsck.8 8.2 (Berkeley) 12/11/93 -.\" $Id: fsck.8,v 1.7 1994/06/08 19:00:20 mycroft Exp $ +.\" from: @(#)fsck.8 8.3 (Berkeley) 11/29/94 +.\" $Id: fsck.8,v 1.8 1994/12/28 00:03:51 mycroft Exp $ .\" -.Dd December 11, 1993 +.Dd November 29, 1994 .Dt FSCK 8 .Os BSD 4 .Sh NAME @@ -182,7 +182,7 @@ do not open the filesystem for writing. Convert the filesystem to the specified level. Note that the level of a filesystem can only be raised. .Bl -tag -width indent -There are currently three levels defined: +There are currently four levels defined: .It 0 The filesystem is in the old (static table) format. .It 1 @@ -191,6 +191,10 @@ The filesystem is in the new (dynamic table) format. The filesystem supports 32-bit uid's and gid's, short symbolic links are stored in the inode, and directories have an added field showing the file type. +.It 3 +If maxcontig is greater than one, +build the free segment maps to aid in finding contiguous sets of blocks. +If maxcontig is equal to one, delete any existing segment maps. .El .Pp In interactive mode, diff --git a/sbin/fsck/pass2.c b/sbin/fsck/pass2.c index 17a6434fdfae..35e524a389e1 100644 --- a/sbin/fsck/pass2.c +++ b/sbin/fsck/pass2.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)pass2.c 8.2 (Berkeley) 2/27/94";*/ -static char *rcsid = "$Id: pass2.c,v 1.9 1994/12/05 20:15:59 cgd Exp $"; +/*static char sccsid[] = "from: @(#)pass2.c 8.6 (Berkeley) 10/27/94";*/ +static char *rcsid = "$Id: pass2.c,v 1.10 1994/12/28 00:03:53 mycroft Exp $"; #endif /* not lint */ #include @@ -108,6 +108,10 @@ pass2() errexit("BAD STATE %d FOR ROOT INODE", statemap[ROOTINO]); } statemap[ROOTINO] = DFOUND; + if (newinofmt) { + statemap[WINO] = FSTATE; + typemap[WINO] = DT_WHT; + } /* * Sort the directory list into disk block order. */ @@ -241,15 +245,15 @@ pass2check(idesc) proto.d_type = 0; proto.d_namlen = 1; (void)strcpy(proto.d_name, "."); -#if BYTE_ORDER == LITTLE_ENDIAN - if (!newinofmt) { - u_char tmp; +# if BYTE_ORDER == LITTLE_ENDIAN + if (!newinofmt) { + u_char tmp; - tmp = proto.d_type; - proto.d_type = proto.d_namlen; - proto.d_namlen = tmp; - } -#endif + tmp = proto.d_type; + proto.d_type = proto.d_namlen; + proto.d_namlen = tmp; + } +# endif entrysize = DIRSIZ(0, &proto); if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n", @@ -366,6 +370,14 @@ chk2: if (dirp->d_ino > maxino) { fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE"); n = reply("REMOVE"); + } else if (newinofmt && + ((dirp->d_ino == WINO && dirp->d_type != DT_WHT) || + (dirp->d_ino != WINO && dirp->d_type == DT_WHT))) { + fileerror(idesc->id_number, dirp->d_ino, "BAD WHITEOUT ENTRY"); + dirp->d_ino = WINO; + dirp->d_type = DT_WHT; + if (reply("FIX") == 1) + ret |= ALTERED; } else { again: switch (statemap[dirp->d_ino]) { diff --git a/sbin/fsck/pass5.c b/sbin/fsck/pass5.c index 65d4934fdde6..ba272f58d6e6 100644 --- a/sbin/fsck/pass5.c +++ b/sbin/fsck/pass5.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)pass5.c 8.2 (Berkeley) 2/2/94";*/ -static char *rcsid = "$Id: pass5.c,v 1.11 1994/12/18 15:55:41 cgd Exp $"; +/*static char sccsid[] = "from: @(#)pass5.c 8.6 (Berkeley) 11/30/94";*/ +static char *rcsid = "$Id: pass5.c,v 1.12 1994/12/28 00:03:54 mycroft Exp $"; #endif /* not lint */ #include @@ -60,9 +60,10 @@ pass5() register struct cg *newcg = (struct cg *)buf; struct ocg *ocg = (struct ocg *)buf; + statemap[WINO] = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; - if (cvtlevel > 3) { + if (cvtlevel >= 3) { if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) { if (preen) pwarn("DELETING CLUSTERING MAPS\n"); @@ -106,8 +107,7 @@ pass5() case FS_42POSTBLFMT: basesize = (char *)(&ocg->cg_btot[0]) - (char *)(&ocg->cg_firstfield); - sumsize = (char *)&ocg->cg_iused[0] - - (char *)(&ocg->cg_btot[0]); + sumsize = &ocg->cg_iused[0] - (u_int8_t *)(&ocg->cg_btot[0]); mapsize = &ocg->cg_free[howmany(fs->fs_fpg, NBBY)] - (u_char *)&ocg->cg_iused[0]; ocg->cg_magic = CG_MAGIC; diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 89706c44874d..cb44b7c90dd2 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)preen.c 8.1 (Berkeley) 6/5/93";*/ -static char *rcsid = "$Id: preen.c,v 1.9 1994/12/05 20:16:04 cgd Exp $"; +/*static char sccsid[] = "from: @(#)preen.c 8.3 (Berkeley) 12/6/94";*/ +static char *rcsid = "$Id: preen.c,v 1.10 1994/12/28 00:03:55 mycroft Exp $"; #endif /* not lint */ #include @@ -281,47 +281,51 @@ startdisk(dk, checkit) } char * -blockcheck(name) - char *name; +blockcheck(origname) + char *origname; { struct stat stslash, stblock, stchar; - char *raw; + char *newname, *raw; int retried = 0; hotroot = 0; if (stat("/", &stslash) < 0) { perror("/"); printf("Can't stat root\n"); - return (0); + return (origname); } + newname = origname; retry: - if (stat(name, &stblock) < 0) { - perror(name); - printf("Can't stat %s\n", name); - return (0); + if (stat(newname, &stblock) < 0) { + perror(newname); + printf("Can't stat %s\n", newname); + return (origname); } if (S_ISBLK(stblock.st_mode)) { if (stslash.st_dev == stblock.st_rdev) hotroot++; - raw = rawname(name); + raw = rawname(newname); if (stat(raw, &stchar) < 0) { perror(raw); printf("Can't stat %s\n", raw); - return (name); + return (origname); } if (S_ISCHR(stchar.st_mode)) { return (raw); } else { printf("%s is not a character device\n", raw); - return (name); + return (origname); } } else if (S_ISCHR(stblock.st_mode) && !retried) { - name = unrawname(name); + newname = unrawname(newname); retried++; goto retry; } - printf("Can't make sense out of name %s\n", name); - return (0); + /* + * Not a block or character device, just return name and + * let the user decide whether to use it. + */ + return (origname); } char * diff --git a/sbin/fsck/setup.c b/sbin/fsck/setup.c index 48574d931675..880ae3e0070d 100644 --- a/sbin/fsck/setup.c +++ b/sbin/fsck/setup.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)setup.c 8.2 (Berkeley) 2/21/94";*/ -static char *rcsid = "$Id: setup.c,v 1.17 1994/12/27 19:26:57 mycroft Exp $"; +/*static char sccsid[] = "from: @(#)setup.c 8.5 (Berkeley) 11/23/94";*/ +static char *rcsid = "$Id: setup.c,v 1.18 1994/12/28 00:03:57 mycroft Exp $"; #endif /* not lint */ #define DKTYPENAMES @@ -360,9 +360,9 @@ readsb(listerr) altsblock.fs_optim = sblock.fs_optim; altsblock.fs_rotdelay = sblock.fs_rotdelay; altsblock.fs_maxbpg = sblock.fs_maxbpg; - altsblock.fs_maxcluster = sblock.fs_maxcluster; memcpy(altsblock.fs_csp, sblock.fs_csp, sizeof sblock.fs_csp); + altsblock.fs_maxcluster = sblock.fs_maxcluster; memcpy(altsblock.fs_fsmnt, sblock.fs_fsmnt, sizeof sblock.fs_fsmnt); memcpy(altsblock.fs_sparecon, sblock.fs_sparecon, @@ -374,11 +374,26 @@ readsb(listerr) altsblock.fs_interleave = sblock.fs_interleave; altsblock.fs_npsect = sblock.fs_npsect; altsblock.fs_nrpos = sblock.fs_nrpos; + altsblock.fs_state = sblock.fs_state; altsblock.fs_qbmask = sblock.fs_qbmask; altsblock.fs_qfmask = sblock.fs_qfmask; altsblock.fs_state = sblock.fs_state; altsblock.fs_maxfilesize = sblock.fs_maxfilesize; if (memcmp(&sblock, &altsblock, (int)sblock.fs_sbsize)) { + if (debug) { + long *nlp, *olp, *endlp; + + printf("superblock mismatches\n"); + nlp = (long *)&altsblock; + olp = (long *)&sblock; + endlp = olp + (sblock.fs_sbsize / sizeof *olp); + for ( ; olp < endlp; olp++, nlp++) { + if (*olp == *nlp) + continue; + printf("offset %d, original %d, alternate %d\n", + olp - (long *)&sblock, *olp, *nlp); + } + } badsb(listerr, "VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE"); return (0); diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 1a0e17ffc10c..ce0a44aa44d8 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)dir.c 8.1 (Berkeley) 6/5/93";*/ -static char *rcsid = "$Id: dir.c,v 1.15 1994/12/05 20:15:44 cgd Exp $"; +/*static char sccsid[] = "from: @(#)dir.c 8.5 (Berkeley) 12/8/94";*/ +static char *rcsid = "$Id: dir.c,v 1.16 1994/12/28 00:03:49 mycroft Exp $"; #endif /* not lint */ #include @@ -348,11 +348,11 @@ mkentry(idesc) dirp->d_reclen = oldlen; dirp = (struct direct *)(((char *)dirp) + oldlen); dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */ + dirp->d_reclen = newent.d_reclen; if (newinofmt) dirp->d_type = typemap[idesc->id_parent]; else dirp->d_type = 0; - dirp->d_reclen = newent.d_reclen; dirp->d_namlen = newent.d_namlen; memcpy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1); # if (BYTE_ORDER == LITTLE_ENDIAN) diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8 index 9282527d3bf3..1c19abeaff67 100644 --- a/sbin/fsck_ffs/fsck_ffs.8 +++ b/sbin/fsck_ffs/fsck_ffs.8 @@ -29,10 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)fsck.8 8.2 (Berkeley) 12/11/93 -.\" $Id: fsck_ffs.8,v 1.7 1994/06/08 19:00:20 mycroft Exp $ +.\" from: @(#)fsck.8 8.3 (Berkeley) 11/29/94 +.\" $Id: fsck_ffs.8,v 1.8 1994/12/28 00:03:51 mycroft Exp $ .\" -.Dd December 11, 1993 +.Dd November 29, 1994 .Dt FSCK 8 .Os BSD 4 .Sh NAME @@ -182,7 +182,7 @@ do not open the filesystem for writing. Convert the filesystem to the specified level. Note that the level of a filesystem can only be raised. .Bl -tag -width indent -There are currently three levels defined: +There are currently four levels defined: .It 0 The filesystem is in the old (static table) format. .It 1 @@ -191,6 +191,10 @@ The filesystem is in the new (dynamic table) format. The filesystem supports 32-bit uid's and gid's, short symbolic links are stored in the inode, and directories have an added field showing the file type. +.It 3 +If maxcontig is greater than one, +build the free segment maps to aid in finding contiguous sets of blocks. +If maxcontig is equal to one, delete any existing segment maps. .El .Pp In interactive mode, diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index 17a6434fdfae..35e524a389e1 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)pass2.c 8.2 (Berkeley) 2/27/94";*/ -static char *rcsid = "$Id: pass2.c,v 1.9 1994/12/05 20:15:59 cgd Exp $"; +/*static char sccsid[] = "from: @(#)pass2.c 8.6 (Berkeley) 10/27/94";*/ +static char *rcsid = "$Id: pass2.c,v 1.10 1994/12/28 00:03:53 mycroft Exp $"; #endif /* not lint */ #include @@ -108,6 +108,10 @@ pass2() errexit("BAD STATE %d FOR ROOT INODE", statemap[ROOTINO]); } statemap[ROOTINO] = DFOUND; + if (newinofmt) { + statemap[WINO] = FSTATE; + typemap[WINO] = DT_WHT; + } /* * Sort the directory list into disk block order. */ @@ -241,15 +245,15 @@ pass2check(idesc) proto.d_type = 0; proto.d_namlen = 1; (void)strcpy(proto.d_name, "."); -#if BYTE_ORDER == LITTLE_ENDIAN - if (!newinofmt) { - u_char tmp; +# if BYTE_ORDER == LITTLE_ENDIAN + if (!newinofmt) { + u_char tmp; - tmp = proto.d_type; - proto.d_type = proto.d_namlen; - proto.d_namlen = tmp; - } -#endif + tmp = proto.d_type; + proto.d_type = proto.d_namlen; + proto.d_namlen = tmp; + } +# endif entrysize = DIRSIZ(0, &proto); if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n", @@ -366,6 +370,14 @@ chk2: if (dirp->d_ino > maxino) { fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE"); n = reply("REMOVE"); + } else if (newinofmt && + ((dirp->d_ino == WINO && dirp->d_type != DT_WHT) || + (dirp->d_ino != WINO && dirp->d_type == DT_WHT))) { + fileerror(idesc->id_number, dirp->d_ino, "BAD WHITEOUT ENTRY"); + dirp->d_ino = WINO; + dirp->d_type = DT_WHT; + if (reply("FIX") == 1) + ret |= ALTERED; } else { again: switch (statemap[dirp->d_ino]) { diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 65d4934fdde6..ba272f58d6e6 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)pass5.c 8.2 (Berkeley) 2/2/94";*/ -static char *rcsid = "$Id: pass5.c,v 1.11 1994/12/18 15:55:41 cgd Exp $"; +/*static char sccsid[] = "from: @(#)pass5.c 8.6 (Berkeley) 11/30/94";*/ +static char *rcsid = "$Id: pass5.c,v 1.12 1994/12/28 00:03:54 mycroft Exp $"; #endif /* not lint */ #include @@ -60,9 +60,10 @@ pass5() register struct cg *newcg = (struct cg *)buf; struct ocg *ocg = (struct ocg *)buf; + statemap[WINO] = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; - if (cvtlevel > 3) { + if (cvtlevel >= 3) { if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) { if (preen) pwarn("DELETING CLUSTERING MAPS\n"); @@ -106,8 +107,7 @@ pass5() case FS_42POSTBLFMT: basesize = (char *)(&ocg->cg_btot[0]) - (char *)(&ocg->cg_firstfield); - sumsize = (char *)&ocg->cg_iused[0] - - (char *)(&ocg->cg_btot[0]); + sumsize = &ocg->cg_iused[0] - (u_int8_t *)(&ocg->cg_btot[0]); mapsize = &ocg->cg_free[howmany(fs->fs_fpg, NBBY)] - (u_char *)&ocg->cg_iused[0]; ocg->cg_magic = CG_MAGIC; diff --git a/sbin/fsck_ffs/preen.c b/sbin/fsck_ffs/preen.c index 89706c44874d..cb44b7c90dd2 100644 --- a/sbin/fsck_ffs/preen.c +++ b/sbin/fsck_ffs/preen.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)preen.c 8.1 (Berkeley) 6/5/93";*/ -static char *rcsid = "$Id: preen.c,v 1.9 1994/12/05 20:16:04 cgd Exp $"; +/*static char sccsid[] = "from: @(#)preen.c 8.3 (Berkeley) 12/6/94";*/ +static char *rcsid = "$Id: preen.c,v 1.10 1994/12/28 00:03:55 mycroft Exp $"; #endif /* not lint */ #include @@ -281,47 +281,51 @@ startdisk(dk, checkit) } char * -blockcheck(name) - char *name; +blockcheck(origname) + char *origname; { struct stat stslash, stblock, stchar; - char *raw; + char *newname, *raw; int retried = 0; hotroot = 0; if (stat("/", &stslash) < 0) { perror("/"); printf("Can't stat root\n"); - return (0); + return (origname); } + newname = origname; retry: - if (stat(name, &stblock) < 0) { - perror(name); - printf("Can't stat %s\n", name); - return (0); + if (stat(newname, &stblock) < 0) { + perror(newname); + printf("Can't stat %s\n", newname); + return (origname); } if (S_ISBLK(stblock.st_mode)) { if (stslash.st_dev == stblock.st_rdev) hotroot++; - raw = rawname(name); + raw = rawname(newname); if (stat(raw, &stchar) < 0) { perror(raw); printf("Can't stat %s\n", raw); - return (name); + return (origname); } if (S_ISCHR(stchar.st_mode)) { return (raw); } else { printf("%s is not a character device\n", raw); - return (name); + return (origname); } } else if (S_ISCHR(stblock.st_mode) && !retried) { - name = unrawname(name); + newname = unrawname(newname); retried++; goto retry; } - printf("Can't make sense out of name %s\n", name); - return (0); + /* + * Not a block or character device, just return name and + * let the user decide whether to use it. + */ + return (origname); } char * diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 48574d931675..880ae3e0070d 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -32,8 +32,8 @@ */ #ifndef lint -/*static char sccsid[] = "from: @(#)setup.c 8.2 (Berkeley) 2/21/94";*/ -static char *rcsid = "$Id: setup.c,v 1.17 1994/12/27 19:26:57 mycroft Exp $"; +/*static char sccsid[] = "from: @(#)setup.c 8.5 (Berkeley) 11/23/94";*/ +static char *rcsid = "$Id: setup.c,v 1.18 1994/12/28 00:03:57 mycroft Exp $"; #endif /* not lint */ #define DKTYPENAMES @@ -360,9 +360,9 @@ readsb(listerr) altsblock.fs_optim = sblock.fs_optim; altsblock.fs_rotdelay = sblock.fs_rotdelay; altsblock.fs_maxbpg = sblock.fs_maxbpg; - altsblock.fs_maxcluster = sblock.fs_maxcluster; memcpy(altsblock.fs_csp, sblock.fs_csp, sizeof sblock.fs_csp); + altsblock.fs_maxcluster = sblock.fs_maxcluster; memcpy(altsblock.fs_fsmnt, sblock.fs_fsmnt, sizeof sblock.fs_fsmnt); memcpy(altsblock.fs_sparecon, sblock.fs_sparecon, @@ -374,11 +374,26 @@ readsb(listerr) altsblock.fs_interleave = sblock.fs_interleave; altsblock.fs_npsect = sblock.fs_npsect; altsblock.fs_nrpos = sblock.fs_nrpos; + altsblock.fs_state = sblock.fs_state; altsblock.fs_qbmask = sblock.fs_qbmask; altsblock.fs_qfmask = sblock.fs_qfmask; altsblock.fs_state = sblock.fs_state; altsblock.fs_maxfilesize = sblock.fs_maxfilesize; if (memcmp(&sblock, &altsblock, (int)sblock.fs_sbsize)) { + if (debug) { + long *nlp, *olp, *endlp; + + printf("superblock mismatches\n"); + nlp = (long *)&altsblock; + olp = (long *)&sblock; + endlp = olp + (sblock.fs_sbsize / sizeof *olp); + for ( ; olp < endlp; olp++, nlp++) { + if (*olp == *nlp) + continue; + printf("offset %d, original %d, alternate %d\n", + olp - (long *)&sblock, *olp, *nlp); + } + } badsb(listerr, "VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE"); return (0);