blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the
cursor lies in the middle of the space that the meta node represents, then blanking the low bits of mask may make it zero, and break later code that expects a nonzero value. Add a test that returns failure if the mask has been cleared. Submitted by: Doug Moore <dougm@rice.edu> Reported by: pho Tested by: pho X-MFC with: r340402 Differential Revision: https://reviews.freebsd.org/D18058
This commit is contained in:
parent
96d4562982
commit
f296f3e51e
@ -764,6 +764,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix)
|
||||
/* Discard any candidates that appear before cursor. */
|
||||
digit = (cursor / radix) & BLIST_META_MASK;
|
||||
mask &= (u_daddr_t)-1 << digit;
|
||||
if (mask == 0)
|
||||
return (SWAPBLK_NONE);
|
||||
|
||||
/*
|
||||
* If the first try is for a block that includes the cursor, pre-undo
|
||||
|
Loading…
x
Reference in New Issue
Block a user