Btrfs: check-int: don't complain about balanced blocks
The xfstest btrfs/014 which tests the balance operation caused that the check_int module complained that known blocks changed their physical location. Since this is not an error in this case, only print such message if the verbose mode was enabled. Reported-by: Wang Shilong <wangshilong1991@gmail.com> Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Tested-by: Wang Shilong <wangshilong1991@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
committed by
Chris Mason
parent
f382e4653f
commit
cf90c59e68
@@ -1323,24 +1323,25 @@ static int btrfsic_create_link_to_next_block(
|
|||||||
l = NULL;
|
l = NULL;
|
||||||
next_block->generation = BTRFSIC_GENERATION_UNKNOWN;
|
next_block->generation = BTRFSIC_GENERATION_UNKNOWN;
|
||||||
} else {
|
} else {
|
||||||
if (next_block->logical_bytenr != next_bytenr &&
|
if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) {
|
||||||
!(!next_block->is_metadata &&
|
if (next_block->logical_bytenr != next_bytenr &&
|
||||||
0 == next_block->logical_bytenr)) {
|
!(!next_block->is_metadata &&
|
||||||
printk(KERN_INFO
|
0 == next_block->logical_bytenr))
|
||||||
"Referenced block @%llu (%s/%llu/%d)"
|
printk(KERN_INFO
|
||||||
" found in hash table, %c,"
|
"Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
|
||||||
" bytenr mismatch (!= stored %llu).\n",
|
next_bytenr, next_block_ctx->dev->name,
|
||||||
next_bytenr, next_block_ctx->dev->name,
|
next_block_ctx->dev_bytenr, *mirror_nump,
|
||||||
next_block_ctx->dev_bytenr, *mirror_nump,
|
btrfsic_get_block_type(state,
|
||||||
btrfsic_get_block_type(state, next_block),
|
next_block),
|
||||||
next_block->logical_bytenr);
|
next_block->logical_bytenr);
|
||||||
} else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
|
else
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"Referenced block @%llu (%s/%llu/%d)"
|
"Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n",
|
||||||
" found in hash table, %c.\n",
|
next_bytenr, next_block_ctx->dev->name,
|
||||||
next_bytenr, next_block_ctx->dev->name,
|
next_block_ctx->dev_bytenr, *mirror_nump,
|
||||||
next_block_ctx->dev_bytenr, *mirror_nump,
|
btrfsic_get_block_type(state,
|
||||||
btrfsic_get_block_type(state, next_block));
|
next_block));
|
||||||
|
}
|
||||||
next_block->logical_bytenr = next_bytenr;
|
next_block->logical_bytenr = next_bytenr;
|
||||||
|
|
||||||
next_block->mirror_num = *mirror_nump;
|
next_block->mirror_num = *mirror_nump;
|
||||||
@@ -1526,7 +1527,9 @@ static int btrfsic_handle_extent_data(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!block_was_created) {
|
if (!block_was_created) {
|
||||||
if (next_block->logical_bytenr != next_bytenr &&
|
if ((state->print_mask &
|
||||||
|
BTRFSIC_PRINT_MASK_VERBOSE) &&
|
||||||
|
next_block->logical_bytenr != next_bytenr &&
|
||||||
!(!next_block->is_metadata &&
|
!(!next_block->is_metadata &&
|
||||||
0 == next_block->logical_bytenr)) {
|
0 == next_block->logical_bytenr)) {
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
@@ -1879,25 +1882,26 @@ again:
|
|||||||
dev_state,
|
dev_state,
|
||||||
dev_bytenr);
|
dev_bytenr);
|
||||||
}
|
}
|
||||||
if (block->logical_bytenr != bytenr &&
|
if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) {
|
||||||
!(!block->is_metadata &&
|
if (block->logical_bytenr != bytenr &&
|
||||||
block->logical_bytenr == 0))
|
!(!block->is_metadata &&
|
||||||
printk(KERN_INFO
|
block->logical_bytenr == 0))
|
||||||
"Written block @%llu (%s/%llu/%d)"
|
printk(KERN_INFO
|
||||||
" found in hash table, %c,"
|
"Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
|
||||||
" bytenr mismatch"
|
bytenr, dev_state->name,
|
||||||
" (!= stored %llu).\n",
|
dev_bytenr,
|
||||||
bytenr, dev_state->name, dev_bytenr,
|
block->mirror_num,
|
||||||
block->mirror_num,
|
btrfsic_get_block_type(state,
|
||||||
btrfsic_get_block_type(state, block),
|
block),
|
||||||
block->logical_bytenr);
|
block->logical_bytenr);
|
||||||
else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
|
else
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"Written block @%llu (%s/%llu/%d)"
|
"Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
|
||||||
" found in hash table, %c.\n",
|
bytenr, dev_state->name,
|
||||||
bytenr, dev_state->name, dev_bytenr,
|
dev_bytenr, block->mirror_num,
|
||||||
block->mirror_num,
|
btrfsic_get_block_type(state,
|
||||||
btrfsic_get_block_type(state, block));
|
block));
|
||||||
|
}
|
||||||
block->logical_bytenr = bytenr;
|
block->logical_bytenr = bytenr;
|
||||||
} else {
|
} else {
|
||||||
if (num_pages * PAGE_CACHE_SIZE <
|
if (num_pages * PAGE_CACHE_SIZE <
|
||||||
|
|||||||
Reference in New Issue
Block a user