diff options
author | phk <phk@FreeBSD.org> | 1997-08-04 07:30:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-08-04 07:30:43 +0000 |
commit | b3f221cd7a3fd66ee5b374ab332ecdaee4604b5f (patch) | |
tree | fd308303922ccc9ea685511a552c6dface15b04b /sys | |
parent | ba2544a6f0b91693130f57914790cc17ca424abf (diff) | |
download | FreeBSD-src-b3f221cd7a3fd66ee5b374ab332ecdaee4604b5f.zip FreeBSD-src-b3f221cd7a3fd66ee5b374ab332ecdaee4604b5f.tar.gz |
We got a couple of "map mismatch" panics from the following
code. According to the crash dump, bpref is set to 445
and cgp->cg_nclusterblks is 444. Hence in the for loop,
the test fails immediately but the following failure check
(got == cgp->cg_nclusterblks) doesn't trigger because got >
cgp->cg_nclusterblks. This wreaks havoc in the code after that.
Fix: Move one source bit to the left :-)
Noticed by: Mike Hibler <mike@fast.cs.utah.edu>
Submitted by: Kirk McKusick <mckusick@McKusick.COM>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 3483b56..2edfa10 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 - * $Id: ffs_alloc.c,v 1.32 1997/03/22 06:53:28 bde Exp $ + * $Id: ffs_alloc.c,v 1.33 1997/03/23 20:08:16 guido Exp $ */ #include "opt_quota.h" @@ -1139,7 +1139,7 @@ ffs_clusteralloc(ip, cg, bpref, len) bit = 1; } } - if (got == cgp->cg_nclusterblks) + if (got >= cgp->cg_nclusterblks) goto fail; /* * Allocate the cluster that we have found. |