From 90e05a748a1017aed5ff5bcb5b436d29ccf5f0f6 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 19 Jan 1998 16:55:26 +0000 Subject: [PATCH] Don't create superblocks with size larger than SBSIZE (8192). The size was rounded up to a multiple of the fragment size, but this gave invalid file systems when the fragment size was > SBSIZE (fsck aborts early on them). Now a fragment size of 32768 seems to work (too-simple tests with fsck and iozone worked). --- sbin/newfs/mkfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 6531437a6c06..c2322566a260 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -501,6 +501,8 @@ mkfs(pp, fsys, fi, fo) sblock.fs_npsect = nphyssectors; sblock.fs_postblformat = FS_DYNAMICPOSTBLFMT; sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs)); + if (sblock.fs_sbsize > SBSIZE) + sblock.fs_sbsize = SBSIZE; if (sblock.fs_ntrak == 1) { sblock.fs_cpc = 0; goto next; @@ -532,6 +534,8 @@ mkfs(pp, fsys, fi, fo) goto next; } sblock.fs_sbsize = fragroundup(&sblock, totalsbsize); + if (sblock.fs_sbsize > SBSIZE) + sblock.fs_sbsize = SBSIZE; /* * calculate the available blocks for each rotational position */