On 2020/2/7 上午11:49, Chiung-Ming Huang wrote: > Qu Wenruo 於 2020年2月6日 週四 下午12:35寫道: >> >> Here is the diff, should be pretty safe: >> diff --git a/check/main.c b/check/main.c >> index 7db65150048b..bcde157c415d 100644 >> --- a/check/main.c >> +++ b/check/main.c >> @@ -10373,7 +10373,8 @@ static int cmd_check(const struct cmd_struct >> *cmd, int argc, char **argv) >> ctx.tp = TASK_ROOT_ITEMS; >> task_start(ctx.info, &ctx.start_time, >> &ctx.item_count); >> } >> - ret = repair_root_items(info); >> + if (repair) >> + ret = repair_root_items(info); >> task_stop(ctx.info); >> if (ret < 0) { >> err = !!ret; >> > > I applied this patch and executed `btrfs check /dev/bcache4`. It showed these. > Opening filesystem to check... > Checking filesystem on /dev/bcache4 > UUID: 0b79cf54-c424-40ed-adca-bd66b38ad57a > [1/7] checking root items > [2/7] checking extents > parent transid verify failed on 7153357357056 wanted 1382980 found 1452673 > parent transid verify failed on 7153357357056 wanted 1382980 found 1452673 > parent transid verify failed on 7153357357056 wanted 1382980 found 1452673 Extent tree corrupted by transid. Already a bad news. > Ignoring transid failure > leaf parent key incorrect 7153357357056 > bad block 7153357357056 > ERROR: errors found in extent allocation tree or chunk allocation > [3/7] checking free space cache > cache and super generation don't match, space cache will be invalidated > [4/7] checking fs roots > root 5 root dir 256 not found > root 257 root dir 256 not found > root 258 root dir 256 not found > root 277 root dir 256 not found > root 278 root dir 256 not found > root 279 root dir 256 not found > root 280 root dir 256 not found > root 283 root dir 256 not found > root 286 root dir 256 not found > root 289 root dir 256 not found > root 292 root dir 256 not found > root 295 root dir 256 not found > root 298 root dir 256 not found > root 304 root dir 256 not found > root 307 root dir 256 not found > root 310 root dir 256 not found > root 313 root dir 256 not found > root 316 root dir 256 not found > root 319 root dir 256 not found > root 322 root dir 256 not found > root 325 root dir 256 not found > root 360 root dir 256 not found > root 367 root dir 256 not found > root 370 root dir 256 not found > root 373 root dir 256 not found > root 376 root dir 256 not found > root 380 root dir 256 not found > root 383 root dir 256 not found > root 386 root dir 256 not found > root 389 root dir 256 not found > root 392 root dir 256 not found > root 399 root dir 256 not found > root 402 root dir 256 not found > root 405 root dir 256 not found > root 408 root dir 256 not found > root 411 root dir 256 not found > root 414 root dir 256 not found > root 417 root dir 256 not found > root 420 root dir 256 not found > root 423 root dir 256 not found > root 426 root dir 256 not found > root 429 root dir 256 not found > root 439 root dir 256 not found > root 442 root dir 256 not found > root 445 root dir 256 not found > root 448 root dir 256 not found > root 451 root dir 256 not found > root 513 root dir 256 not found > root 4613 root dir 256 not found > root 4616 root dir 256 not found > root 4619 root dir 256 not found > root 4622 root dir 256 not found > root 4625 root dir 256 not found > root 4628 root dir 256 not found > root 4631 root dir 256 not found > root 4640 root dir 256 not found > root 4643 root dir 256 not found > root 4646 root dir 256 not found > root 4649 root dir 256 not found > root 4652 root dir 256 not found > root 4673 root dir 256 not found > root 18871 root dir 256 not found > root 19354 root dir 256 not found > root 19355 root dir 256 not found > root 19356 root dir 256 not found > root 19375 root dir 256 not found > root 19416 root dir 256 not found > root 19419 root dir 256 not found > root 19422 root dir 256 not found > root 19425 root dir 256 not found > root 19428 root dir 256 not found > root 19432 root dir 256 not found > root 19435 root dir 256 not found > root 19438 root dir 256 not found > root 19441 root dir 256 not found > root 19450 root dir 256 not found > root 19453 root dir 256 not found > root 19456 root dir 256 not found > root 19459 root dir 256 not found > root 19462 root dir 256 not found > root 19465 root dir 256 not found > root 19468 root dir 256 not found > root 19472 root dir 256 not found > root 19473 root dir 256 not found > root 19613 root dir 256 not found > root 19784 root dir 256 not found > root 19812 root dir 256 not found > root 20572 root dir 256 not found > root 20768 root dir 256 not found > root 20771 root dir 256 not found > root 20834 root dir 256 not found > root 20837 root dir 256 not found > root 21438 root dir 256 not found > root 21447 root dir 256 not found > root 21469 root dir 256 not found > root 21470 root dir 256 not found > root 23144 root dir 256 not found > root 23146 root dir 256 not found > root 23147 root dir 256 not found > root 23440 root dir 256 not found > root 23452 root dir 256 not found > root 23460 root dir 256 not found > root 23471 root dir 256 not found > root 23520 root dir 256 not found > root 23521 root dir 256 not found > root 23833 root dir 256 not found > root 23834 root dir 256 not found > root 23854 root dir 256 not found > root 23855 root dir 256 not found All these subvolumes had a missing root dir. That's not good either. I guess btrfs-restore is your last chance, or RO mount with my rescue=skipbg patchset: https://patchwork.kernel.org/project/linux-btrfs/list/?series=170715 Thanks, Qu > ERROR: errors found in fs roots > found 1902526464 bytes used, error(s) found > total csum bytes: 0 > total tree bytes: 6275072 > total fs tree bytes: 1032192 > total extent tree bytes: 409600 > btree space waste bytes: 974245 > file data blocks allocated: 1628962816 > referenced 1628962816 > > Regards, > Chiung-Ming Huang >