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: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50070: fsck OK but mount: incorrect super block
Date: Mon, 3 Aug 2015 17:31:35 +0200

 This cgsize test from ffs_superblock_validate() is wrong.  Newfs aligns
 fs_cgsize to fragment size:
 
 	sblock.fs_cgsize = ffs_fragroundup(&sblock, CGSIZE(&sblock));
 
 All we should test here is
 
 	fs->fs_cgsize >= sizeof(struct cg)
 	fs->fs_cgsize <= fs->fs_bsize
 
 These tests are sufficient to read/write cylinder groups, to validate
 individual cylinder groups we should make cg_chkmagic() a function
 and add tests for all cg_*off fields there.
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)
 


Home | Main Index | Thread Index | Old Index