The following reply was made to PR kernel/6426; it has been noted by GNATS.
From: Otto Moerbeek <[email protected]> To: Benny Lofgren <[email protected]> Cc: [email protected], [email protected] Subject: Re: kernel/6426: Kernel panic in ffs_dirpref() at mkdir on a freshly created very large ffs2 fs Date: Sat, 10 Jul 2010 18:23:54 +0200 Hi, Very good chanche this fixes your problem. From FreeBSD. -Otto Index: ffs_alloc.c =================================================================== RCS file: /cvs/src/sys/ufs/ffs/ffs_alloc.c,v retrieving revision 1.88 diff -u -p -r1.88 ffs_alloc.c --- ffs_alloc.c 16 Jan 2010 15:45:10 -0000 1.88 +++ ffs_alloc.c 10 Jul 2010 16:22:16 -0000 @@ -983,7 +983,10 @@ ffs_dirpref(struct inode *pip) curdirsize = avgndir ? (cgsize - avgbfree * fs->fs_bsize) / avgndir : 0; if (dirsize < curdirsize) dirsize = curdirsize; - maxcontigdirs = min(avgbfree * fs->fs_bsize / dirsize, 255); + if (dirsize <= 0) + maxcontigdirs = 0; /* dirsize overflowed */ + else + maxcontigdirs = min(avgbfree * fs->fs_bsize / dirsize, 255); if (fs->fs_avgfpdir > 0) maxcontigdirs = min(maxcontigdirs, fs->fs_ipg / fs->fs_avgfpdir);
