mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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>
This commit is contained in:
parent
ee461acc1a
commit
3758b280f2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27890
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user