NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50070: fsck OK but mount: incorrect super block



The following reply was made to PR kern/50070; it has been noted by GNATS.

From: Martin Husemann <martin%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50070: fsck OK but mount: incorrect super block
Date: Sun, 2 Aug 2015 14:40:14 +0000

 On Mon, Jul 20, 2015 at 10:45:01PM +0000, David Holland wrote:
 >  
 >  The test is spewing drivel; the maximum cgsize is one block, which is
 >  0x4000, so fs->fs_cgsize is correct and CGSIZE() is hallucinating.
 >  
 >  Would probably be a good idea to find out why, though, rather than
 >  just disabling the test.
 
 Here is a simple test program that shows it calculating bogus values (based
 on the values found in my superblock).
 
 Martin
 
 --8<--
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
 
 #include <sys/param.h>
 #include <sys/types.h>
 #include </usr/src/sys/ufs/ffs/fs.h>
 
 int main(int argc, char **argv)
 {
 	struct fs sblock;
 	uint64_t cs;
 
 	memset(&sblock, 0,sizeof sblock);
 
 	sblock.fs_sblkno = 8;
 	sblock.fs_ncg = 610;
 	sblock.fs_bsize = 16384;
 	sblock.fs_frag = 8;
 	sblock.fs_minfree = 5;
 	sblock.fs_bmask = 0xffffc000;
 	sblock.fs_fmask = 0xfffff800;
 	sblock.fs_bshift = 14;
 	sblock.fs_fshift = 11;
 	sblock.fs_maxcontig = 4;
 	sblock.fs_maxbpg = 4096;
 	sblock.fs_fragshift = 3;
 	sblock.fs_fsbtodb = 2;
 	sblock.fs_sbsize = sizeof(sblock);
 	sblock.fs_nindir = 4096;
 	sblock.fs_inopb = 128;
 	sblock.fs_contigsumsize = 4;
 	sblock.fs_old_cpg = 1;
 	sblock.fs_ipg = 23296;
 	sblock.fs_fpg = 94368;
 	sblock.fs_sblockloc = 8192;
 	sblock.fs_id[0] = 0x4c4ad59b;
 	sblock.fs_id[1] = 0x16a2beb3;
 	sblock.fs_size = 57561588;
 	sblock.fs_dsize = 56663655;
 	sblock.fs_cssize = 10240;
 	sblock.fs_cgsize = 16384;
 	sblock.fs_qbmask = ~(uint64_t)sblock.fs_bmask;
 	sblock.fs_qfmask = ~(uint64_t)sblock.fs_fmask;
 
 	cs = CGSIZE(&sblock);
 	printf("CGSIZE(fs) : %" PRIu64 "\n", cs);
 
 	return 0;
 }
 


Home | Main Index | Thread Index | Old Index