Commit 8e9c6b5
btrfs-progs: check: auto-detect chunk level when --chunk-root is specified
[BUG]
There is a bug report that, when using --chunk-root option, if the
specified chunk root tree block has a different level than the one in
the super block, btrfs check will reject the run:
ERROR: root [3 0] level 0 does not match 1
ERROR: cannot read chunk root
ERROR: cannot open file system
Opening filesystem to check...
[CAUSE]
During btrfs_setup_chunk_tree_and_device_map(), although it accepts a
@chunk_root_bytenr parameter, it still uses the chunk root level from
the super block.
Thus if the provided chunk root is at a different level, it will still
be rejected.
[FIX]
Read out the tree block at @chunk_root_bytenr, and use the level from
the tree block instead.
Pull-request: #1037
Link: https://lore.kernel.org/linux-btrfs/CAKZK7uxiRmDxk-1goC4yj7QZPSmL-=GAoAuF=OdekbSNVrG8fg@mail.gmail.com/
Signed-off-by: Qu Wenruo <wqu@suse.com>1 parent 6ff4ae7 commit 8e9c6b5
File tree
1 file changed
+20
-6
lines changed1 file changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1439 | 1439 | | |
1440 | 1440 | | |
1441 | 1441 | | |
| 1442 | + | |
1442 | 1443 | | |
1443 | 1444 | | |
1444 | 1445 | | |
| |||
1448 | 1449 | | |
1449 | 1450 | | |
1450 | 1451 | | |
1451 | | - | |
1452 | | - | |
1453 | 1452 | | |
1454 | 1453 | | |
1455 | 1454 | | |
1456 | 1455 | | |
1457 | 1456 | | |
1458 | 1457 | | |
1459 | 1458 | | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1463 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
1464 | 1478 | | |
1465 | 1479 | | |
1466 | | - | |
| 1480 | + | |
1467 | 1481 | | |
1468 | 1482 | | |
1469 | 1483 | | |
| |||
0 commit comments