Single values are allowed in regular duplicate nodes
Not in duplicate fragments, however. This oversight in hrev44359 made checkfs incorrectly rebuild valid indices, causing #8762. Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
This commit is contained in:
parent
4d99b24ded
commit
35dc734b48
@ -2350,18 +2350,21 @@ BPlusTree::_ValidateChildren(TreeCheck& check, uint32 level, off_t offset,
|
||||
check.SetVisitedFragment(duplicateOffset);
|
||||
|
||||
duplicate_array* array;
|
||||
int32 minSize;
|
||||
int32 maxSize;
|
||||
if (isFragmentNode) {
|
||||
array = node->FragmentAt(
|
||||
bplustree_node::FragmentIndex(childOffset));
|
||||
minSize = 2;
|
||||
maxSize = NUM_FRAGMENT_VALUES;
|
||||
} else {
|
||||
array = node->DuplicateArray();
|
||||
minSize = 1;
|
||||
maxSize = NUM_DUPLICATE_VALUES;
|
||||
}
|
||||
int32 arrayCount = array->Count();
|
||||
|
||||
if (arrayCount <= 1 || arrayCount > maxSize) {
|
||||
if (arrayCount < minSize || arrayCount > maxSize) {
|
||||
dprintf("inode %" B_PRIdOFF ": duplicate at %" B_PRIdOFF
|
||||
" has invalid array size %" B_PRId32 "!\n",
|
||||
fStream->ID(), duplicateOffset, arrayCount);
|
||||
|
Loading…
Reference in New Issue
Block a user