The "dirpref" directory layout preference improvements make use of

an array "fs_contigdirs[]" to avoid too many directories getting
created in each cylinder group. The memory required for this and
two other arrays (fs_csp[] and fs_maxcluster[]) is allocated with
a single malloc() call, and divided up afterwards.  However, the
'space' pointer is not advanced correctly, so fs_contigdirs and
fs_maxcluster end up pointing to the same address.

Add the missing code to advance the 'space' pointer, and remove
an unnecessary update of the pointer that follows.

This is likely to fix the "ffs_clusteralloc: map mismatch" panics
that have been reported recently.

Submitted by:		Luke Mewburn <lukem@wasabisystems.com>
This commit is contained in:
iedowse 2001-09-09 23:48:28 +00:00
parent cfad1534f8
commit ddaced1703

View File

@ -684,10 +684,10 @@ ffs_mountfs(devvp, mp, p, malloctype)
fs->fs_maxcluster = lp = space;
for (i = 0; i < fs->fs_ncg; i++)
*lp++ = fs->fs_contigsumsize;
space = lp;
}
size = fs->fs_ncg * sizeof(u_int8_t);
fs->fs_contigdirs = (u_int8_t *)space;
space = (u_int8_t *)space + size;
bzero(fs->fs_contigdirs, size);
/* Compatibility for old filesystems XXX */
if (fs->fs_avgfilesize <= 0) /* XXX */