diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2014-10-17 08:10:10 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-11-20 20:14:30 -0500 |
commit | cf90c59e680ee83c263a60ee2cd464a7d96cc6d5 (patch) | |
tree | 4180e8631539de5cbe7f7b89c996407c2dbc2869 /fs/btrfs | |
parent | f382e4653f06f4e285b7800f80e6548e026f90a8 (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/check-integrity.c | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index b5aa8124bf47..47cb267b8ac7 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -1323,24 +1323,25 @@ static int btrfsic_create_link_to_next_block( | |||
1323 | l = NULL; | 1323 | l = NULL; |
1324 | next_block->generation = BTRFSIC_GENERATION_UNKNOWN; | 1324 | next_block->generation = BTRFSIC_GENERATION_UNKNOWN; |
1325 | } else { | 1325 | } else { |
1326 | if (next_block->logical_bytenr != next_bytenr && | 1326 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) { |
1327 | !(!next_block->is_metadata && | 1327 | if (next_block->logical_bytenr != next_bytenr && |
1328 | 0 == next_block->logical_bytenr)) { | 1328 | !(!next_block->is_metadata && |
1329 | printk(KERN_INFO | 1329 | 0 == next_block->logical_bytenr)) |
1330 | "Referenced block @%llu (%s/%llu/%d)" | 1330 | printk(KERN_INFO |
1331 | " found in hash table, %c," | 1331 | "Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n", |
1332 | " bytenr mismatch (!= stored %llu).\n", | 1332 | next_bytenr, next_block_ctx->dev->name, |
1333 | next_bytenr, next_block_ctx->dev->name, | 1333 | next_block_ctx->dev_bytenr, *mirror_nump, |
1334 | next_block_ctx->dev_bytenr, *mirror_nump, | 1334 | btrfsic_get_block_type(state, |
1335 | btrfsic_get_block_type(state, next_block), | 1335 | next_block), |
1336 | next_block->logical_bytenr); | 1336 | next_block->logical_bytenr); |
1337 | } else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 1337 | else |
1338 | printk(KERN_INFO | 1338 | printk(KERN_INFO |
1339 | "Referenced block @%llu (%s/%llu/%d)" | 1339 | "Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n", |
1340 | " found in hash table, %c.\n", | 1340 | next_bytenr, next_block_ctx->dev->name, |
1341 | next_bytenr, next_block_ctx->dev->name, | 1341 | next_block_ctx->dev_bytenr, *mirror_nump, |
1342 | next_block_ctx->dev_bytenr, *mirror_nump, | 1342 | btrfsic_get_block_type(state, |
1343 | btrfsic_get_block_type(state, next_block)); | 1343 | next_block)); |
1344 | } | ||
1344 | next_block->logical_bytenr = next_bytenr; | 1345 | next_block->logical_bytenr = next_bytenr; |
1345 | 1346 | ||
1346 | next_block->mirror_num = *mirror_nump; | 1347 | next_block->mirror_num = *mirror_nump; |
@@ -1526,7 +1527,9 @@ static int btrfsic_handle_extent_data( | |||
1526 | return -1; | 1527 | return -1; |
1527 | } | 1528 | } |
1528 | if (!block_was_created) { | 1529 | if (!block_was_created) { |
1529 | if (next_block->logical_bytenr != next_bytenr && | 1530 | if ((state->print_mask & |
1531 | BTRFSIC_PRINT_MASK_VERBOSE) && | ||
1532 | next_block->logical_bytenr != next_bytenr && | ||
1530 | !(!next_block->is_metadata && | 1533 | !(!next_block->is_metadata && |
1531 | 0 == next_block->logical_bytenr)) { | 1534 | 0 == next_block->logical_bytenr)) { |
1532 | printk(KERN_INFO | 1535 | printk(KERN_INFO |
@@ -1879,25 +1882,26 @@ again: | |||
1879 | dev_state, | 1882 | dev_state, |
1880 | dev_bytenr); | 1883 | dev_bytenr); |
1881 | } | 1884 | } |
1882 | if (block->logical_bytenr != bytenr && | 1885 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) { |
1883 | !(!block->is_metadata && | 1886 | if (block->logical_bytenr != bytenr && |
1884 | block->logical_bytenr == 0)) | 1887 | !(!block->is_metadata && |
1885 | printk(KERN_INFO | 1888 | block->logical_bytenr == 0)) |
1886 | "Written block @%llu (%s/%llu/%d)" | 1889 | printk(KERN_INFO |
1887 | " found in hash table, %c," | 1890 | "Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n", |
1888 | " bytenr mismatch" | 1891 | bytenr, dev_state->name, |
1889 | " (!= stored %llu).\n", | 1892 | dev_bytenr, |
1890 | bytenr, dev_state->name, dev_bytenr, | 1893 | block->mirror_num, |
1891 | block->mirror_num, | 1894 | btrfsic_get_block_type(state, |
1892 | btrfsic_get_block_type(state, block), | 1895 | block), |
1893 | block->logical_bytenr); | 1896 | block->logical_bytenr); |
1894 | else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 1897 | else |
1895 | printk(KERN_INFO | 1898 | printk(KERN_INFO |
1896 | "Written block @%llu (%s/%llu/%d)" | 1899 | "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n", |
1897 | " found in hash table, %c.\n", | 1900 | bytenr, dev_state->name, |
1898 | bytenr, dev_state->name, dev_bytenr, | 1901 | dev_bytenr, block->mirror_num, |
1899 | block->mirror_num, | 1902 | btrfsic_get_block_type(state, |
1900 | btrfsic_get_block_type(state, block)); | 1903 | block)); |
1904 | } | ||
1901 | block->logical_bytenr = bytenr; | 1905 | block->logical_bytenr = bytenr; |
1902 | } else { | 1906 | } else { |
1903 | if (num_pages * PAGE_CACHE_SIZE < | 1907 | if (num_pages * PAGE_CACHE_SIZE < |