diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 017b67daa3bb..84a495967e0a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -6042,9 +6042,10 @@ static void btrfs_end_bio(struct bio *bio) | |||
6042 | struct btrfs_bio *bbio = bio->bi_private; | 6042 | struct btrfs_bio *bbio = bio->bi_private; |
6043 | int is_orig_bio = 0; | 6043 | int is_orig_bio = 0; |
6044 | 6044 | ||
6045 | if (bio->bi_error) { | 6045 | if (bio->bi_status) { |
6046 | atomic_inc(&bbio->error); | 6046 | atomic_inc(&bbio->error); |
6047 | if (bio->bi_error == -EIO || bio->bi_error == -EREMOTEIO) { | 6047 | if (bio->bi_status == BLK_STS_IOERR || |
6048 | bio->bi_status == BLK_STS_TARGET) { | ||
6048 | unsigned int stripe_index = | 6049 | unsigned int stripe_index = |
6049 | btrfs_io_bio(bio)->stripe_index; | 6050 | btrfs_io_bio(bio)->stripe_index; |
6050 | struct btrfs_device *dev; | 6051 | struct btrfs_device *dev; |
@@ -6082,13 +6083,13 @@ static void btrfs_end_bio(struct bio *bio) | |||
6082 | * beyond the tolerance of the btrfs bio | 6083 | * beyond the tolerance of the btrfs bio |
6083 | */ | 6084 | */ |
6084 | if (atomic_read(&bbio->error) > bbio->max_errors) { | 6085 | if (atomic_read(&bbio->error) > bbio->max_errors) { |
6085 | bio->bi_error = -EIO; | 6086 | bio->bi_status = BLK_STS_IOERR; |
6086 | } else { | 6087 | } else { |
6087 | /* | 6088 | /* |
6088 | * this bio is actually up to date, we didn't | 6089 | * this bio is actually up to date, we didn't |
6089 | * go over the max number of errors | 6090 | * go over the max number of errors |
6090 | */ | 6091 | */ |
6091 | bio->bi_error = 0; | 6092 | bio->bi_status = 0; |
6092 | } | 6093 | } |
6093 | 6094 | ||
6094 | btrfs_end_bbio(bbio, bio); | 6095 | btrfs_end_bbio(bbio, bio); |
@@ -6199,7 +6200,7 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) | |||
6199 | 6200 | ||
6200 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; | 6201 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; |
6201 | bio->bi_iter.bi_sector = logical >> 9; | 6202 | bio->bi_iter.bi_sector = logical >> 9; |
6202 | bio->bi_error = -EIO; | 6203 | bio->bi_status = BLK_STS_IOERR; |
6203 | btrfs_end_bbio(bbio, bio); | 6204 | btrfs_end_bbio(bbio, bio); |
6204 | } | 6205 | } |
6205 | } | 6206 | } |