diff options
Diffstat (limited to 'fs/btrfs/check-integrity.c')
-rw-r--r-- | fs/btrfs/check-integrity.c | 143 |
1 files changed, 40 insertions, 103 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 183c98f58e82..d6a5a6eebd11 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -733,9 +733,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state, | |||
733 | &tmp_next_block_ctx, | 733 | &tmp_next_block_ctx, |
734 | mirror_num); | 734 | mirror_num); |
735 | if (ret) { | 735 | if (ret) { |
736 | printk(KERN_INFO "btrfsic:" | 736 | printk(KERN_INFO "btrfsic: btrfsic_map_block(root @%llu, mirror %d) failed!\n", |
737 | " btrfsic_map_block(root @%llu," | ||
738 | " mirror %d) failed!\n", | ||
739 | next_bytenr, mirror_num); | 737 | next_bytenr, mirror_num); |
740 | kfree(selected_super); | 738 | kfree(selected_super); |
741 | return -1; | 739 | return -1; |
@@ -905,8 +903,7 @@ static int btrfsic_process_superblock_dev_mirror( | |||
905 | state->metablock_size, | 903 | state->metablock_size, |
906 | &tmp_next_block_ctx, | 904 | &tmp_next_block_ctx, |
907 | mirror_num)) { | 905 | mirror_num)) { |
908 | printk(KERN_INFO "btrfsic: btrfsic_map_block(" | 906 | printk(KERN_INFO "btrfsic: btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n", |
909 | "bytenr @%llu, mirror %d) failed!\n", | ||
910 | next_bytenr, mirror_num); | 907 | next_bytenr, mirror_num); |
911 | brelse(bh); | 908 | brelse(bh); |
912 | return -1; | 909 | return -1; |
@@ -995,8 +992,7 @@ continue_with_new_stack_frame: | |||
995 | 992 | ||
996 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 993 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
997 | printk(KERN_INFO | 994 | printk(KERN_INFO |
998 | "leaf %llu items %d generation %llu" | 995 | "leaf %llu items %d generation %llu owner %llu\n", |
999 | " owner %llu\n", | ||
1000 | sf->block_ctx->start, sf->nr, | 996 | sf->block_ctx->start, sf->nr, |
1001 | btrfs_stack_header_generation( | 997 | btrfs_stack_header_generation( |
1002 | &leafhdr->header), | 998 | &leafhdr->header), |
@@ -1120,8 +1116,7 @@ leaf_item_out_of_bounce_error: | |||
1120 | sf->nr = btrfs_stack_header_nritems(&nodehdr->header); | 1116 | sf->nr = btrfs_stack_header_nritems(&nodehdr->header); |
1121 | 1117 | ||
1122 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 1118 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
1123 | printk(KERN_INFO "node %llu level %d items %d" | 1119 | printk(KERN_INFO "node %llu level %d items %d generation %llu owner %llu\n", |
1124 | " generation %llu owner %llu\n", | ||
1125 | sf->block_ctx->start, | 1120 | sf->block_ctx->start, |
1126 | nodehdr->header.level, sf->nr, | 1121 | nodehdr->header.level, sf->nr, |
1127 | btrfs_stack_header_generation( | 1122 | btrfs_stack_header_generation( |
@@ -1457,8 +1452,7 @@ static int btrfsic_handle_extent_data( | |||
1457 | generation = btrfs_stack_file_extent_generation(&file_extent_item); | 1452 | generation = btrfs_stack_file_extent_generation(&file_extent_item); |
1458 | 1453 | ||
1459 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) | 1454 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) |
1460 | printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu," | 1455 | printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu, offset = %llu, num_bytes = %llu\n", |
1461 | " offset = %llu, num_bytes = %llu\n", | ||
1462 | file_extent_item.type, | 1456 | file_extent_item.type, |
1463 | btrfs_stack_file_extent_disk_bytenr(&file_extent_item), | 1457 | btrfs_stack_file_extent_disk_bytenr(&file_extent_item), |
1464 | btrfs_stack_file_extent_offset(&file_extent_item), | 1458 | btrfs_stack_file_extent_offset(&file_extent_item), |
@@ -1485,8 +1479,7 @@ static int btrfsic_handle_extent_data( | |||
1485 | int block_was_created; | 1479 | int block_was_created; |
1486 | 1480 | ||
1487 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 1481 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
1488 | printk(KERN_INFO "btrfsic_handle_extent_data(" | 1482 | printk(KERN_INFO "btrfsic_handle_extent_data(mirror_num=%d)\n", mirror_num); |
1489 | "mirror_num=%d)\n", mirror_num); | ||
1490 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) | 1483 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) |
1491 | printk(KERN_INFO | 1484 | printk(KERN_INFO |
1492 | "\tdisk_bytenr = %llu, num_bytes %u\n", | 1485 | "\tdisk_bytenr = %llu, num_bytes %u\n", |
@@ -1496,8 +1489,7 @@ static int btrfsic_handle_extent_data( | |||
1496 | mirror_num); | 1489 | mirror_num); |
1497 | if (ret) { | 1490 | if (ret) { |
1498 | printk(KERN_INFO | 1491 | printk(KERN_INFO |
1499 | "btrfsic: btrfsic_map_block(@%llu," | 1492 | "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n", |
1500 | " mirror=%d) failed!\n", | ||
1501 | next_bytenr, mirror_num); | 1493 | next_bytenr, mirror_num); |
1502 | return -1; | 1494 | return -1; |
1503 | } | 1495 | } |
@@ -1524,11 +1516,7 @@ static int btrfsic_handle_extent_data( | |||
1524 | !(!next_block->is_metadata && | 1516 | !(!next_block->is_metadata && |
1525 | 0 == next_block->logical_bytenr)) { | 1517 | 0 == next_block->logical_bytenr)) { |
1526 | printk(KERN_INFO | 1518 | printk(KERN_INFO |
1527 | "Referenced block" | 1519 | "Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu).\n", |
1528 | " @%llu (%s/%llu/%d)" | ||
1529 | " found in hash table, D," | ||
1530 | " bytenr mismatch" | ||
1531 | " (!= stored %llu).\n", | ||
1532 | next_bytenr, | 1520 | next_bytenr, |
1533 | next_block_ctx.dev->name, | 1521 | next_block_ctx.dev->name, |
1534 | next_block_ctx.dev_bytenr, | 1522 | next_block_ctx.dev_bytenr, |
@@ -1725,9 +1713,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state) | |||
1725 | b_all->dev_bytenr, b_all->mirror_num); | 1713 | b_all->dev_bytenr, b_all->mirror_num); |
1726 | 1714 | ||
1727 | list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) { | 1715 | list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) { |
1728 | printk(KERN_INFO " %c @%llu (%s/%llu/%d)" | 1716 | printk(KERN_INFO " %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n", |
1729 | " refers %u* to" | ||
1730 | " %c @%llu (%s/%llu/%d)\n", | ||
1731 | btrfsic_get_block_type(state, b_all), | 1717 | btrfsic_get_block_type(state, b_all), |
1732 | b_all->logical_bytenr, b_all->dev_state->name, | 1718 | b_all->logical_bytenr, b_all->dev_state->name, |
1733 | b_all->dev_bytenr, b_all->mirror_num, | 1719 | b_all->dev_bytenr, b_all->mirror_num, |
@@ -1740,9 +1726,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state) | |||
1740 | } | 1726 | } |
1741 | 1727 | ||
1742 | list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) { | 1728 | list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) { |
1743 | printk(KERN_INFO " %c @%llu (%s/%llu/%d)" | 1729 | printk(KERN_INFO " %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n", |
1744 | " is ref %u* from" | ||
1745 | " %c @%llu (%s/%llu/%d)\n", | ||
1746 | btrfsic_get_block_type(state, b_all), | 1730 | btrfsic_get_block_type(state, b_all), |
1747 | b_all->logical_bytenr, b_all->dev_state->name, | 1731 | b_all->logical_bytenr, b_all->dev_state->name, |
1748 | b_all->dev_bytenr, b_all->mirror_num, | 1732 | b_all->dev_bytenr, b_all->mirror_num, |
@@ -1891,8 +1875,7 @@ again: | |||
1891 | bytenr = block->logical_bytenr; | 1875 | bytenr = block->logical_bytenr; |
1892 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 1876 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
1893 | printk(KERN_INFO | 1877 | printk(KERN_INFO |
1894 | "Written block @%llu (%s/%llu/%d)" | 1878 | "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n", |
1895 | " found in hash table, %c.\n", | ||
1896 | bytenr, dev_state->name, dev_bytenr, | 1879 | bytenr, dev_state->name, dev_bytenr, |
1897 | block->mirror_num, | 1880 | block->mirror_num, |
1898 | btrfsic_get_block_type(state, block)); | 1881 | btrfsic_get_block_type(state, block)); |
@@ -1904,12 +1887,7 @@ again: | |||
1904 | list_empty(&block->ref_to_list) ? ' ' : '!', | 1887 | list_empty(&block->ref_to_list) ? ' ' : '!', |
1905 | list_empty(&block->ref_from_list) ? ' ' : '!'); | 1888 | list_empty(&block->ref_from_list) ? ' ' : '!'); |
1906 | if (btrfsic_is_block_ref_by_superblock(state, block, 0)) { | 1889 | if (btrfsic_is_block_ref_by_superblock(state, block, 0)) { |
1907 | printk(KERN_INFO "btrfs: attempt to overwrite %c-block" | 1890 | printk(KERN_INFO "btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), old(gen=%llu, objectid=%llu, type=%d, offset=%llu), new(gen=%llu), which is referenced by most recent superblock (superblockgen=%llu)!\n", |
1908 | " @%llu (%s/%llu/%d), old(gen=%llu," | ||
1909 | " objectid=%llu, type=%d, offset=%llu)," | ||
1910 | " new(gen=%llu)," | ||
1911 | " which is referenced by most recent superblock" | ||
1912 | " (superblockgen=%llu)!\n", | ||
1913 | btrfsic_get_block_type(state, block), bytenr, | 1891 | btrfsic_get_block_type(state, block), bytenr, |
1914 | dev_state->name, dev_bytenr, block->mirror_num, | 1892 | dev_state->name, dev_bytenr, block->mirror_num, |
1915 | block->generation, | 1893 | block->generation, |
@@ -1923,9 +1901,7 @@ again: | |||
1923 | } | 1901 | } |
1924 | 1902 | ||
1925 | if (!block->is_iodone && !block->never_written) { | 1903 | if (!block->is_iodone && !block->never_written) { |
1926 | printk(KERN_INFO "btrfs: attempt to overwrite %c-block" | 1904 | printk(KERN_INFO "btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu, which is not yet iodone!\n", |
1927 | " @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu," | ||
1928 | " which is not yet iodone!\n", | ||
1929 | btrfsic_get_block_type(state, block), bytenr, | 1905 | btrfsic_get_block_type(state, block), bytenr, |
1930 | dev_state->name, dev_bytenr, block->mirror_num, | 1906 | dev_state->name, dev_bytenr, block->mirror_num, |
1931 | block->generation, | 1907 | block->generation, |
@@ -2037,8 +2013,7 @@ again: | |||
2037 | } | 2013 | } |
2038 | if (ret) | 2014 | if (ret) |
2039 | printk(KERN_INFO | 2015 | printk(KERN_INFO |
2040 | "btrfsic: btrfsic_process_metablock" | 2016 | "btrfsic: btrfsic_process_metablock(root @%llu) failed!\n", |
2041 | "(root @%llu) failed!\n", | ||
2042 | dev_bytenr); | 2017 | dev_bytenr); |
2043 | } else { | 2018 | } else { |
2044 | block->is_metadata = 0; | 2019 | block->is_metadata = 0; |
@@ -2065,8 +2040,7 @@ again: | |||
2065 | if (!is_metadata) { | 2040 | if (!is_metadata) { |
2066 | processed_len = state->datablock_size; | 2041 | processed_len = state->datablock_size; |
2067 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 2042 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
2068 | printk(KERN_INFO "Written block (%s/%llu/?)" | 2043 | printk(KERN_INFO "Written block (%s/%llu/?) !found in hash table, D.\n", |
2069 | " !found in hash table, D.\n", | ||
2070 | dev_state->name, dev_bytenr); | 2044 | dev_state->name, dev_bytenr); |
2071 | if (!state->include_extent_data) { | 2045 | if (!state->include_extent_data) { |
2072 | /* ignore that written D block */ | 2046 | /* ignore that written D block */ |
@@ -2085,8 +2059,7 @@ again: | |||
2085 | dev_bytenr); | 2059 | dev_bytenr); |
2086 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 2060 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
2087 | printk(KERN_INFO | 2061 | printk(KERN_INFO |
2088 | "Written block @%llu (%s/%llu/?)" | 2062 | "Written block @%llu (%s/%llu/?) !found in hash table, M.\n", |
2089 | " !found in hash table, M.\n", | ||
2090 | bytenr, dev_state->name, dev_bytenr); | 2063 | bytenr, dev_state->name, dev_bytenr); |
2091 | } | 2064 | } |
2092 | 2065 | ||
@@ -2163,8 +2136,7 @@ again: | |||
2163 | &block_ctx, 0, 0); | 2136 | &block_ctx, 0, 0); |
2164 | if (ret) | 2137 | if (ret) |
2165 | printk(KERN_INFO | 2138 | printk(KERN_INFO |
2166 | "btrfsic: process_metablock(root @%llu)" | 2139 | "btrfsic: process_metablock(root @%llu) failed!\n", |
2167 | " failed!\n", | ||
2168 | dev_bytenr); | 2140 | dev_bytenr); |
2169 | } | 2141 | } |
2170 | btrfsic_release_block_ctx(&block_ctx); | 2142 | btrfsic_release_block_ctx(&block_ctx); |
@@ -2272,8 +2244,7 @@ static int btrfsic_process_written_superblock( | |||
2272 | 0 == state->max_superblock_generation)) { | 2244 | 0 == state->max_superblock_generation)) { |
2273 | if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) | 2245 | if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) |
2274 | printk(KERN_INFO | 2246 | printk(KERN_INFO |
2275 | "btrfsic: superblock @%llu (%s/%llu/%d)" | 2247 | "btrfsic: superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n", |
2276 | " with old gen %llu <= %llu\n", | ||
2277 | superblock->logical_bytenr, | 2248 | superblock->logical_bytenr, |
2278 | superblock->dev_state->name, | 2249 | superblock->dev_state->name, |
2279 | superblock->dev_bytenr, superblock->mirror_num, | 2250 | superblock->dev_bytenr, superblock->mirror_num, |
@@ -2282,8 +2253,7 @@ static int btrfsic_process_written_superblock( | |||
2282 | } else { | 2253 | } else { |
2283 | if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) | 2254 | if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) |
2284 | printk(KERN_INFO | 2255 | printk(KERN_INFO |
2285 | "btrfsic: got new superblock @%llu (%s/%llu/%d)" | 2256 | "btrfsic: got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n", |
2286 | " with new gen %llu > %llu\n", | ||
2287 | superblock->logical_bytenr, | 2257 | superblock->logical_bytenr, |
2288 | superblock->dev_state->name, | 2258 | superblock->dev_state->name, |
2289 | superblock->dev_bytenr, superblock->mirror_num, | 2259 | superblock->dev_bytenr, superblock->mirror_num, |
@@ -2353,16 +2323,14 @@ static int btrfsic_process_written_superblock( | |||
2353 | 2323 | ||
2354 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 2324 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
2355 | printk(KERN_INFO | 2325 | printk(KERN_INFO |
2356 | "btrfsic_process_written_superblock(" | 2326 | "btrfsic_process_written_superblock(mirror_num=%d)\n", mirror_num); |
2357 | "mirror_num=%d)\n", mirror_num); | ||
2358 | ret = btrfsic_map_block(state, next_bytenr, | 2327 | ret = btrfsic_map_block(state, next_bytenr, |
2359 | BTRFS_SUPER_INFO_SIZE, | 2328 | BTRFS_SUPER_INFO_SIZE, |
2360 | &tmp_next_block_ctx, | 2329 | &tmp_next_block_ctx, |
2361 | mirror_num); | 2330 | mirror_num); |
2362 | if (ret) { | 2331 | if (ret) { |
2363 | printk(KERN_INFO | 2332 | printk(KERN_INFO |
2364 | "btrfsic: btrfsic_map_block(@%llu," | 2333 | "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n", |
2365 | " mirror=%d) failed!\n", | ||
2366 | next_bytenr, mirror_num); | 2334 | next_bytenr, mirror_num); |
2367 | return -1; | 2335 | return -1; |
2368 | } | 2336 | } |
@@ -2438,8 +2406,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2438 | list_for_each_entry(l, &block->ref_to_list, node_ref_to) { | 2406 | list_for_each_entry(l, &block->ref_to_list, node_ref_to) { |
2439 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 2407 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
2440 | printk(KERN_INFO | 2408 | printk(KERN_INFO |
2441 | "rl=%d, %c @%llu (%s/%llu/%d)" | 2409 | "rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n", |
2442 | " %u* refers to %c @%llu (%s/%llu/%d)\n", | ||
2443 | recursion_level, | 2410 | recursion_level, |
2444 | btrfsic_get_block_type(state, block), | 2411 | btrfsic_get_block_type(state, block), |
2445 | block->logical_bytenr, block->dev_state->name, | 2412 | block->logical_bytenr, block->dev_state->name, |
@@ -2451,9 +2418,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2451 | l->block_ref_to->dev_bytenr, | 2418 | l->block_ref_to->dev_bytenr, |
2452 | l->block_ref_to->mirror_num); | 2419 | l->block_ref_to->mirror_num); |
2453 | if (l->block_ref_to->never_written) { | 2420 | if (l->block_ref_to->never_written) { |
2454 | printk(KERN_INFO "btrfs: attempt to write superblock" | 2421 | printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is never written!\n", |
2455 | " which references block %c @%llu (%s/%llu/%d)" | ||
2456 | " which is never written!\n", | ||
2457 | btrfsic_get_block_type(state, l->block_ref_to), | 2422 | btrfsic_get_block_type(state, l->block_ref_to), |
2458 | l->block_ref_to->logical_bytenr, | 2423 | l->block_ref_to->logical_bytenr, |
2459 | l->block_ref_to->dev_state->name, | 2424 | l->block_ref_to->dev_state->name, |
@@ -2461,9 +2426,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2461 | l->block_ref_to->mirror_num); | 2426 | l->block_ref_to->mirror_num); |
2462 | ret = -1; | 2427 | ret = -1; |
2463 | } else if (!l->block_ref_to->is_iodone) { | 2428 | } else if (!l->block_ref_to->is_iodone) { |
2464 | printk(KERN_INFO "btrfs: attempt to write superblock" | 2429 | printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not yet iodone!\n", |
2465 | " which references block %c @%llu (%s/%llu/%d)" | ||
2466 | " which is not yet iodone!\n", | ||
2467 | btrfsic_get_block_type(state, l->block_ref_to), | 2430 | btrfsic_get_block_type(state, l->block_ref_to), |
2468 | l->block_ref_to->logical_bytenr, | 2431 | l->block_ref_to->logical_bytenr, |
2469 | l->block_ref_to->dev_state->name, | 2432 | l->block_ref_to->dev_state->name, |
@@ -2471,9 +2434,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2471 | l->block_ref_to->mirror_num); | 2434 | l->block_ref_to->mirror_num); |
2472 | ret = -1; | 2435 | ret = -1; |
2473 | } else if (l->block_ref_to->iodone_w_error) { | 2436 | } else if (l->block_ref_to->iodone_w_error) { |
2474 | printk(KERN_INFO "btrfs: attempt to write superblock" | 2437 | printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which has write error!\n", |
2475 | " which references block %c @%llu (%s/%llu/%d)" | ||
2476 | " which has write error!\n", | ||
2477 | btrfsic_get_block_type(state, l->block_ref_to), | 2438 | btrfsic_get_block_type(state, l->block_ref_to), |
2478 | l->block_ref_to->logical_bytenr, | 2439 | l->block_ref_to->logical_bytenr, |
2479 | l->block_ref_to->dev_state->name, | 2440 | l->block_ref_to->dev_state->name, |
@@ -2486,10 +2447,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2486 | l->parent_generation && | 2447 | l->parent_generation && |
2487 | BTRFSIC_GENERATION_UNKNOWN != | 2448 | BTRFSIC_GENERATION_UNKNOWN != |
2488 | l->block_ref_to->generation) { | 2449 | l->block_ref_to->generation) { |
2489 | printk(KERN_INFO "btrfs: attempt to write superblock" | 2450 | printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) with generation %llu != parent generation %llu!\n", |
2490 | " which references block %c @%llu (%s/%llu/%d)" | ||
2491 | " with generation %llu !=" | ||
2492 | " parent generation %llu!\n", | ||
2493 | btrfsic_get_block_type(state, l->block_ref_to), | 2451 | btrfsic_get_block_type(state, l->block_ref_to), |
2494 | l->block_ref_to->logical_bytenr, | 2452 | l->block_ref_to->logical_bytenr, |
2495 | l->block_ref_to->dev_state->name, | 2453 | l->block_ref_to->dev_state->name, |
@@ -2500,11 +2458,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state, | |||
2500 | ret = -1; | 2458 | ret = -1; |
2501 | } else if (l->block_ref_to->flush_gen > | 2459 | } else if (l->block_ref_to->flush_gen > |
2502 | l->block_ref_to->dev_state->last_flush_gen) { | 2460 | l->block_ref_to->dev_state->last_flush_gen) { |
2503 | printk(KERN_INFO "btrfs: attempt to write superblock" | 2461 | printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not flushed out of disk's write cache (block flush_gen=%llu, dev->flush_gen=%llu)!\n", |
2504 | " which references block %c @%llu (%s/%llu/%d)" | ||
2505 | " which is not flushed out of disk's write cache" | ||
2506 | " (block flush_gen=%llu," | ||
2507 | " dev->flush_gen=%llu)!\n", | ||
2508 | btrfsic_get_block_type(state, l->block_ref_to), | 2462 | btrfsic_get_block_type(state, l->block_ref_to), |
2509 | l->block_ref_to->logical_bytenr, | 2463 | l->block_ref_to->logical_bytenr, |
2510 | l->block_ref_to->dev_state->name, | 2464 | l->block_ref_to->dev_state->name, |
@@ -2546,8 +2500,7 @@ static int btrfsic_is_block_ref_by_superblock( | |||
2546 | list_for_each_entry(l, &block->ref_from_list, node_ref_from) { | 2500 | list_for_each_entry(l, &block->ref_from_list, node_ref_from) { |
2547 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) | 2501 | if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) |
2548 | printk(KERN_INFO | 2502 | printk(KERN_INFO |
2549 | "rl=%d, %c @%llu (%s/%llu/%d)" | 2503 | "rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n", |
2550 | " is ref %u* from %c @%llu (%s/%llu/%d)\n", | ||
2551 | recursion_level, | 2504 | recursion_level, |
2552 | btrfsic_get_block_type(state, block), | 2505 | btrfsic_get_block_type(state, block), |
2553 | block->logical_bytenr, block->dev_state->name, | 2506 | block->logical_bytenr, block->dev_state->name, |
@@ -2578,8 +2531,7 @@ static void btrfsic_print_add_link(const struct btrfsic_state *state, | |||
2578 | const struct btrfsic_block_link *l) | 2531 | const struct btrfsic_block_link *l) |
2579 | { | 2532 | { |
2580 | printk(KERN_INFO | 2533 | printk(KERN_INFO |
2581 | "Add %u* link from %c @%llu (%s/%llu/%d)" | 2534 | "Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n", |
2582 | " to %c @%llu (%s/%llu/%d).\n", | ||
2583 | l->ref_cnt, | 2535 | l->ref_cnt, |
2584 | btrfsic_get_block_type(state, l->block_ref_from), | 2536 | btrfsic_get_block_type(state, l->block_ref_from), |
2585 | l->block_ref_from->logical_bytenr, | 2537 | l->block_ref_from->logical_bytenr, |
@@ -2595,8 +2547,7 @@ static void btrfsic_print_rem_link(const struct btrfsic_state *state, | |||
2595 | const struct btrfsic_block_link *l) | 2547 | const struct btrfsic_block_link *l) |
2596 | { | 2548 | { |
2597 | printk(KERN_INFO | 2549 | printk(KERN_INFO |
2598 | "Rem %u* link from %c @%llu (%s/%llu/%d)" | 2550 | "Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n", |
2599 | " to %c @%llu (%s/%llu/%d).\n", | ||
2600 | l->ref_cnt, | 2551 | l->ref_cnt, |
2601 | btrfsic_get_block_type(state, l->block_ref_from), | 2552 | btrfsic_get_block_type(state, l->block_ref_from), |
2602 | l->block_ref_from->logical_bytenr, | 2553 | l->block_ref_from->logical_bytenr, |
@@ -2709,7 +2660,7 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add( | |||
2709 | l = btrfsic_block_link_alloc(); | 2660 | l = btrfsic_block_link_alloc(); |
2710 | if (NULL == l) { | 2661 | if (NULL == l) { |
2711 | printk(KERN_INFO | 2662 | printk(KERN_INFO |
2712 | "btrfsic: error, kmalloc" " failed!\n"); | 2663 | "btrfsic: error, kmalloc failed!\n"); |
2713 | return NULL; | 2664 | return NULL; |
2714 | } | 2665 | } |
2715 | 2666 | ||
@@ -2810,9 +2761,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2810 | ret = btrfsic_map_block(state, bytenr, state->metablock_size, | 2761 | ret = btrfsic_map_block(state, bytenr, state->metablock_size, |
2811 | &block_ctx, mirror_num); | 2762 | &block_ctx, mirror_num); |
2812 | if (ret) { | 2763 | if (ret) { |
2813 | printk(KERN_INFO "btrfsic:" | 2764 | printk(KERN_INFO "btrfsic: btrfsic_map_block(logical @%llu, mirror %d) failed!\n", |
2814 | " btrfsic_map_block(logical @%llu," | ||
2815 | " mirror %d) failed!\n", | ||
2816 | bytenr, mirror_num); | 2765 | bytenr, mirror_num); |
2817 | continue; | 2766 | continue; |
2818 | } | 2767 | } |
@@ -2827,9 +2776,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2827 | } | 2776 | } |
2828 | 2777 | ||
2829 | if (WARN_ON(!match)) { | 2778 | if (WARN_ON(!match)) { |
2830 | printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio," | 2779 | printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio, buffer->log_bytenr=%llu, submit_bio(bdev=%s, phys_bytenr=%llu)!\n", |
2831 | " buffer->log_bytenr=%llu, submit_bio(bdev=%s," | ||
2832 | " phys_bytenr=%llu)!\n", | ||
2833 | bytenr, dev_state->name, dev_bytenr); | 2780 | bytenr, dev_state->name, dev_bytenr); |
2834 | for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { | 2781 | for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { |
2835 | ret = btrfsic_map_block(state, bytenr, | 2782 | ret = btrfsic_map_block(state, bytenr, |
@@ -2838,8 +2785,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2838 | if (ret) | 2785 | if (ret) |
2839 | continue; | 2786 | continue; |
2840 | 2787 | ||
2841 | printk(KERN_INFO "Read logical bytenr @%llu maps to" | 2788 | printk(KERN_INFO "Read logical bytenr @%llu maps to (%s/%llu/%d)\n", |
2842 | " (%s/%llu/%d)\n", | ||
2843 | bytenr, block_ctx.dev->name, | 2789 | bytenr, block_ctx.dev->name, |
2844 | block_ctx.dev_bytenr, mirror_num); | 2790 | block_ctx.dev_bytenr, mirror_num); |
2845 | } | 2791 | } |
@@ -2874,8 +2820,7 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh) | |||
2874 | if (dev_state->state->print_mask & | 2820 | if (dev_state->state->print_mask & |
2875 | BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) | 2821 | BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) |
2876 | printk(KERN_INFO | 2822 | printk(KERN_INFO |
2877 | "submit_bh(op=0x%x,0x%x, blocknr=%llu " | 2823 | "submit_bh(op=0x%x,0x%x, blocknr=%llu (bytenr %llu), size=%zu, data=%p, bdev=%p)\n", |
2878 | "(bytenr %llu), size=%zu, data=%p, bdev=%p)\n", | ||
2879 | op, op_flags, (unsigned long long)bh->b_blocknr, | 2824 | op, op_flags, (unsigned long long)bh->b_blocknr, |
2880 | dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev); | 2825 | dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev); |
2881 | btrfsic_process_written_block(dev_state, dev_bytenr, | 2826 | btrfsic_process_written_block(dev_state, dev_bytenr, |
@@ -2892,9 +2837,7 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh) | |||
2892 | (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | | 2837 | (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | |
2893 | BTRFSIC_PRINT_MASK_VERBOSE))) | 2838 | BTRFSIC_PRINT_MASK_VERBOSE))) |
2894 | printk(KERN_INFO | 2839 | printk(KERN_INFO |
2895 | "btrfsic_submit_bh(%s) with FLUSH" | 2840 | "btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n", |
2896 | " but dummy block already in use" | ||
2897 | " (ignored)!\n", | ||
2898 | dev_state->name); | 2841 | dev_state->name); |
2899 | } else { | 2842 | } else { |
2900 | struct btrfsic_block *const block = | 2843 | struct btrfsic_block *const block = |
@@ -2940,8 +2883,7 @@ static void __btrfsic_submit_bio(struct bio *bio) | |||
2940 | if (dev_state->state->print_mask & | 2883 | if (dev_state->state->print_mask & |
2941 | BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) | 2884 | BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) |
2942 | printk(KERN_INFO | 2885 | printk(KERN_INFO |
2943 | "submit_bio(rw=%d,0x%x, bi_vcnt=%u," | 2886 | "submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n", |
2944 | " bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n", | ||
2945 | bio_op(bio), bio->bi_opf, bio->bi_vcnt, | 2887 | bio_op(bio), bio->bi_opf, bio->bi_vcnt, |
2946 | (unsigned long long)bio->bi_iter.bi_sector, | 2888 | (unsigned long long)bio->bi_iter.bi_sector, |
2947 | dev_bytenr, bio->bi_bdev); | 2889 | dev_bytenr, bio->bi_bdev); |
@@ -2990,9 +2932,7 @@ static void __btrfsic_submit_bio(struct bio *bio) | |||
2990 | (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | | 2932 | (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | |
2991 | BTRFSIC_PRINT_MASK_VERBOSE))) | 2933 | BTRFSIC_PRINT_MASK_VERBOSE))) |
2992 | printk(KERN_INFO | 2934 | printk(KERN_INFO |
2993 | "btrfsic_submit_bio(%s) with FLUSH" | 2935 | "btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n", |
2994 | " but dummy block already in use" | ||
2995 | " (ignored)!\n", | ||
2996 | dev_state->name); | 2936 | dev_state->name); |
2997 | } else { | 2937 | } else { |
2998 | struct btrfsic_block *const block = | 2938 | struct btrfsic_block *const block = |
@@ -3146,8 +3086,7 @@ void btrfsic_unmount(struct btrfs_root *root, | |||
3146 | 3086 | ||
3147 | if (NULL == state) { | 3087 | if (NULL == state) { |
3148 | printk(KERN_INFO | 3088 | printk(KERN_INFO |
3149 | "btrfsic: error, cannot find state information" | 3089 | "btrfsic: error, cannot find state information on umount!\n"); |
3150 | " on umount!\n"); | ||
3151 | mutex_unlock(&btrfsic_mutex); | 3090 | mutex_unlock(&btrfsic_mutex); |
3152 | return; | 3091 | return; |
3153 | } | 3092 | } |
@@ -3174,9 +3113,7 @@ void btrfsic_unmount(struct btrfs_root *root, | |||
3174 | if (b_all->is_iodone || b_all->never_written) | 3113 | if (b_all->is_iodone || b_all->never_written) |
3175 | btrfsic_block_free(b_all); | 3114 | btrfsic_block_free(b_all); |
3176 | else | 3115 | else |
3177 | printk(KERN_INFO "btrfs: attempt to free %c-block" | 3116 | printk(KERN_INFO "btrfs: attempt to free %c-block @%llu (%s/%llu/%d) on umount which is not yet iodone!\n", |
3178 | " @%llu (%s/%llu/%d) on umount which is" | ||
3179 | " not yet iodone!\n", | ||
3180 | btrfsic_get_block_type(state, b_all), | 3117 | btrfsic_get_block_type(state, b_all), |
3181 | b_all->logical_bytenr, b_all->dev_state->name, | 3118 | b_all->logical_bytenr, b_all->dev_state->name, |
3182 | b_all->dev_bytenr, b_all->mirror_num); | 3119 | b_all->dev_bytenr, b_all->mirror_num); |