@@ -2301,6 +2301,8 @@ bool btrfs_check_repairable(struct inode *inode, struct bio *failed_bio,
* everything for repair_io_failure to do the rest for us.
*/
if (failrec->in_validation) {
+ if (failrec->this_mirror != failed_mirror)
+ pr_info("%s: logical 0x%llx this_mirror %d failed %d\n", __func__, btrfs_io_bio(failed_bio)->logical, failrec->this_mirror, failed_mirror);
BUG_ON(failrec->this_mirror != failed_mirror);
failrec->in_validation = 0;
failrec->this_mirror = 0;
@@ -6091,6 +6091,7 @@ static void btrfs_end_bio(struct bio *bio)
*/
if (atomic_read(&bbio->error) > bbio->max_errors) {
bio->bi_status = BLK_STS_IOERR;
+ pr_info("%s: logical 0x%llx failed_mirror %d\n", __func__, btrfs_io_bio(bio)->logical, bbio->mirror_num);
} else {
/*
* this bio is actually up to date, we didn't
@@ -6206,6 +6207,8 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical)
WARN_ON(bio != bbio->orig_bio);
btrfs_io_bio(bio)->mirror_num = bbio->mirror_num;
+ pr_info("%s: logical 0x%llx failed_mirror %d\n", __func__, btrfs_io_bio(bio)->logical, bbio->mirror_num);
+
bio->bi_iter.bi_sector = logical >> 9;
bio->bi_status = BLK_STS_IOERR;
btrfs_end_bbio(bbio, bio);