diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2017-03-29 10:54:26 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-04-18 14:07:26 +0200 |
commit | abad60c6013d62f4ddd19667260e2e4a957a9c2a (patch) | |
tree | c4cdc9d387371330e527f0db022778c5d0aad539 /fs/btrfs/raid56.c | |
parent | 1bcd7aa17fc1fa29009feec3e0ac4230d0d9f700 (diff) |
Btrfs: fix wrong failed mirror_num of read-repair on raid56
In raid56 scenario, after trying parity recovery, we didn't set
mirror_num for btrfs_bio with failed mirror_num, hence
end_bio_extent_readpage() will report a random mirror_num in dmesg
log.
Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r-- | fs/btrfs/raid56.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index a8954f5188b4..7bf65d9a9bd3 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -2117,6 +2117,11 @@ int raid56_parity_recover(struct btrfs_fs_info *fs_info, struct bio *bio, struct btrfs_raid_bio *rbio; int ret; + if (generic_io) { + ASSERT(bbio->mirror_num == mirror_num); + btrfs_io_bio(bio)->mirror_num = mirror_num; + } + rbio = alloc_rbio(fs_info, bbio, stripe_len); if (IS_ERR(rbio)) { if (generic_io) |