aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2017-08-23 02:45:59 -0400
committerDavid Sterba <dsterba@suse.com>2017-08-24 11:19:02 -0400
commit58efbc9f5463308c43d812fd0748a4dee44c8a16 (patch)
tree400bd7ce429cf0ef769c3736dcb153f28dfdbcee
parent14ccee78fc82f5512908f4424f541549a5705b89 (diff)
Btrfs: fix blk_status_t/errno confusion
This fixes several instances of blk_status_t and bare errno ints being mixed up, some of which are real bugs. In the normal case, 0 matches BLK_STS_OK, so we don't observe any effects of the missing conversion, but in case of errors or passes through the repair/retry paths, the errors get mixed up. The changes were identified using 'sparse', we don't have reports of the buggy behaviour. Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t") Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/disk-io.c4
-rw-r--r--fs/btrfs/inode.c70
-rw-r--r--fs/btrfs/raid56.c34
-rw-r--r--fs/btrfs/volumes.c10
-rw-r--r--fs/btrfs/volumes.h6
5 files changed, 64 insertions, 60 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 080e2ebb8aa0..f45b61fe9a9a 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3516,7 +3516,7 @@ static blk_status_t wait_dev_flush(struct btrfs_device *device)
3516 struct bio *bio = device->flush_bio; 3516 struct bio *bio = device->flush_bio;
3517 3517
3518 if (!device->flush_bio_sent) 3518 if (!device->flush_bio_sent)
3519 return 0; 3519 return BLK_STS_OK;
3520 3520
3521 device->flush_bio_sent = 0; 3521 device->flush_bio_sent = 0;
3522 wait_for_completion_io(&device->flush_wait); 3522 wait_for_completion_io(&device->flush_wait);
@@ -3563,7 +3563,7 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3563 continue; 3563 continue;
3564 3564
3565 write_dev_flush(dev); 3565 write_dev_flush(dev);
3566 dev->last_flush_error = 0; 3566 dev->last_flush_error = BLK_STS_OK;
3567 } 3567 }
3568 3568
3569 /* wait for all the barriers */ 3569 /* wait for all the barriers */
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 95c212037095..24bcd5cd9cf2 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7924,11 +7924,12 @@ err:
7924 return ret; 7924 return ret;
7925} 7925}
7926 7926
7927static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio, 7927static inline blk_status_t submit_dio_repair_bio(struct inode *inode,
7928 int mirror_num) 7928 struct bio *bio,
7929 int mirror_num)
7929{ 7930{
7930 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 7931 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
7931 int ret; 7932 blk_status_t ret;
7932 7933
7933 BUG_ON(bio_op(bio) == REQ_OP_WRITE); 7934 BUG_ON(bio_op(bio) == REQ_OP_WRITE);
7934 7935
@@ -7980,10 +7981,10 @@ static int btrfs_check_dio_repairable(struct inode *inode,
7980 return 1; 7981 return 1;
7981} 7982}
7982 7983
7983static int dio_read_error(struct inode *inode, struct bio *failed_bio, 7984static blk_status_t dio_read_error(struct inode *inode, struct bio *failed_bio,
7984 struct page *page, unsigned int pgoff, 7985 struct page *page, unsigned int pgoff,
7985 u64 start, u64 end, int failed_mirror, 7986 u64 start, u64 end, int failed_mirror,
7986 bio_end_io_t *repair_endio, void *repair_arg) 7987 bio_end_io_t *repair_endio, void *repair_arg)
7987{ 7988{
7988 struct io_failure_record *failrec; 7989 struct io_failure_record *failrec;
7989 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; 7990 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
@@ -7993,18 +7994,19 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
7993 int read_mode = 0; 7994 int read_mode = 0;
7994 int segs; 7995 int segs;
7995 int ret; 7996 int ret;
7997 blk_status_t status;
7996 7998
7997 BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE); 7999 BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE);
7998 8000
7999 ret = btrfs_get_io_failure_record(inode, start, end, &failrec); 8001 ret = btrfs_get_io_failure_record(inode, start, end, &failrec);
8000 if (ret) 8002 if (ret)
8001 return ret; 8003 return errno_to_blk_status(ret);
8002 8004
8003 ret = btrfs_check_dio_repairable(inode, failed_bio, failrec, 8005 ret = btrfs_check_dio_repairable(inode, failed_bio, failrec,
8004 failed_mirror); 8006 failed_mirror);
8005 if (!ret) { 8007 if (!ret) {
8006 free_io_failure(failure_tree, io_tree, failrec); 8008 free_io_failure(failure_tree, io_tree, failrec);
8007 return -EIO; 8009 return BLK_STS_IOERR;
8008 } 8010 }
8009 8011
8010 segs = bio_segments(failed_bio); 8012 segs = bio_segments(failed_bio);
@@ -8022,13 +8024,13 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
8022 "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n", 8024 "Repair DIO Read Error: submitting new dio read[%#x] to this_mirror=%d, in_validation=%d\n",
8023 read_mode, failrec->this_mirror, failrec->in_validation); 8025 read_mode, failrec->this_mirror, failrec->in_validation);
8024 8026
8025 ret = submit_dio_repair_bio(inode, bio, failrec->this_mirror); 8027 status = submit_dio_repair_bio(inode, bio, failrec->this_mirror);
8026 if (ret) { 8028 if (status) {
8027 free_io_failure(failure_tree, io_tree, failrec); 8029 free_io_failure(failure_tree, io_tree, failrec);
8028 bio_put(bio); 8030 bio_put(bio);
8029 } 8031 }
8030 8032
8031 return ret; 8033 return status;
8032} 8034}
8033 8035
8034struct btrfs_retry_complete { 8036struct btrfs_retry_complete {
@@ -8065,8 +8067,8 @@ end:
8065 bio_put(bio); 8067 bio_put(bio);
8066} 8068}
8067 8069
8068static int __btrfs_correct_data_nocsum(struct inode *inode, 8070static blk_status_t __btrfs_correct_data_nocsum(struct inode *inode,
8069 struct btrfs_io_bio *io_bio) 8071 struct btrfs_io_bio *io_bio)
8070{ 8072{
8071 struct btrfs_fs_info *fs_info; 8073 struct btrfs_fs_info *fs_info;
8072 struct bio_vec bvec; 8074 struct bio_vec bvec;
@@ -8076,8 +8078,8 @@ static int __btrfs_correct_data_nocsum(struct inode *inode,
8076 unsigned int pgoff; 8078 unsigned int pgoff;
8077 u32 sectorsize; 8079 u32 sectorsize;
8078 int nr_sectors; 8080 int nr_sectors;
8079 int ret; 8081 blk_status_t ret;
8080 int err = 0; 8082 blk_status_t err = BLK_STS_OK;
8081 8083
8082 fs_info = BTRFS_I(inode)->root->fs_info; 8084 fs_info = BTRFS_I(inode)->root->fs_info;
8083 sectorsize = fs_info->sectorsize; 8085 sectorsize = fs_info->sectorsize;
@@ -8183,11 +8185,12 @@ static blk_status_t __btrfs_subio_endio_read(struct inode *inode,
8183 int csum_pos; 8185 int csum_pos;
8184 bool uptodate = (err == 0); 8186 bool uptodate = (err == 0);
8185 int ret; 8187 int ret;
8188 blk_status_t status;
8186 8189
8187 fs_info = BTRFS_I(inode)->root->fs_info; 8190 fs_info = BTRFS_I(inode)->root->fs_info;
8188 sectorsize = fs_info->sectorsize; 8191 sectorsize = fs_info->sectorsize;
8189 8192
8190 err = 0; 8193 err = BLK_STS_OK;
8191 start = io_bio->logical; 8194 start = io_bio->logical;
8192 done.inode = inode; 8195 done.inode = inode;
8193 io_bio->bio.bi_iter = io_bio->iter; 8196 io_bio->bio.bi_iter = io_bio->iter;
@@ -8209,12 +8212,12 @@ try_again:
8209 done.start = start; 8212 done.start = start;
8210 init_completion(&done.done); 8213 init_completion(&done.done);
8211 8214
8212 ret = dio_read_error(inode, &io_bio->bio, bvec.bv_page, 8215 status = dio_read_error(inode, &io_bio->bio, bvec.bv_page,
8213 pgoff, start, start + sectorsize - 1, 8216 pgoff, start, start + sectorsize - 1,
8214 io_bio->mirror_num, 8217 io_bio->mirror_num, btrfs_retry_endio,
8215 btrfs_retry_endio, &done); 8218 &done);
8216 if (ret) { 8219 if (status) {
8217 err = errno_to_blk_status(ret); 8220 err = status;
8218 goto next; 8221 goto next;
8219 } 8222 }
8220 8223
@@ -8250,7 +8253,7 @@ static blk_status_t btrfs_subio_endio_read(struct inode *inode,
8250 if (unlikely(err)) 8253 if (unlikely(err))
8251 return __btrfs_correct_data_nocsum(inode, io_bio); 8254 return __btrfs_correct_data_nocsum(inode, io_bio);
8252 else 8255 else
8253 return 0; 8256 return BLK_STS_OK;
8254 } else { 8257 } else {
8255 return __btrfs_subio_endio_read(inode, io_bio, err); 8258 return __btrfs_subio_endio_read(inode, io_bio, err);
8256 } 8259 }
@@ -8423,9 +8426,9 @@ static inline blk_status_t btrfs_lookup_and_bind_dio_csum(struct inode *inode,
8423 return 0; 8426 return 0;
8424} 8427}
8425 8428
8426static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, 8429static inline blk_status_t
8427 u64 file_offset, int skip_sum, 8430__btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, u64 file_offset,
8428 int async_submit) 8431 int skip_sum, int async_submit)
8429{ 8432{
8430 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 8433 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
8431 struct btrfs_dio_private *dip = bio->bi_private; 8434 struct btrfs_dio_private *dip = bio->bi_private;
@@ -8488,6 +8491,7 @@ static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip,
8488 int clone_offset = 0; 8491 int clone_offset = 0;
8489 int clone_len; 8492 int clone_len;
8490 int ret; 8493 int ret;
8494 blk_status_t status;
8491 8495
8492 map_length = orig_bio->bi_iter.bi_size; 8496 map_length = orig_bio->bi_iter.bi_size;
8493 submit_len = map_length; 8497 submit_len = map_length;
@@ -8537,9 +8541,9 @@ static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip,
8537 */ 8541 */
8538 atomic_inc(&dip->pending_bios); 8542 atomic_inc(&dip->pending_bios);
8539 8543
8540 ret = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum, 8544 status = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum,
8541 async_submit); 8545 async_submit);
8542 if (ret) { 8546 if (status) {
8543 bio_put(bio); 8547 bio_put(bio);
8544 atomic_dec(&dip->pending_bios); 8548 atomic_dec(&dip->pending_bios);
8545 goto out_err; 8549 goto out_err;
@@ -8557,9 +8561,9 @@ static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip,
8557 } while (submit_len > 0); 8561 } while (submit_len > 0);
8558 8562
8559submit: 8563submit:
8560 ret = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum, 8564 status = __btrfs_submit_dio_bio(bio, inode, file_offset, skip_sum,
8561 async_submit); 8565 async_submit);
8562 if (!ret) 8566 if (!status)
8563 return 0; 8567 return 0;
8564 8568
8565 bio_put(bio); 8569 bio_put(bio);
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 208638384cd2..2cf6ba40f7c4 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -905,7 +905,7 @@ static void raid_write_end_io(struct bio *bio)
905 if (!atomic_dec_and_test(&rbio->stripes_pending)) 905 if (!atomic_dec_and_test(&rbio->stripes_pending))
906 return; 906 return;
907 907
908 err = 0; 908 err = BLK_STS_OK;
909 909
910 /* OK, we have read all the stripes we need to. */ 910 /* OK, we have read all the stripes we need to. */
911 max_errors = (rbio->operation == BTRFS_RBIO_PARITY_SCRUB) ? 911 max_errors = (rbio->operation == BTRFS_RBIO_PARITY_SCRUB) ?
@@ -1324,7 +1324,7 @@ write_data:
1324 return; 1324 return;
1325 1325
1326cleanup: 1326cleanup:
1327 rbio_orig_end_io(rbio, -EIO); 1327 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1328} 1328}
1329 1329
1330/* 1330/*
@@ -1475,7 +1475,7 @@ static void raid_rmw_end_io(struct bio *bio)
1475 1475
1476cleanup: 1476cleanup:
1477 1477
1478 rbio_orig_end_io(rbio, -EIO); 1478 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1479} 1479}
1480 1480
1481static void async_rmw_stripe(struct btrfs_raid_bio *rbio) 1481static void async_rmw_stripe(struct btrfs_raid_bio *rbio)
@@ -1579,7 +1579,7 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio)
1579 return 0; 1579 return 0;
1580 1580
1581cleanup: 1581cleanup:
1582 rbio_orig_end_io(rbio, -EIO); 1582 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1583 return -EIO; 1583 return -EIO;
1584 1584
1585finish: 1585finish:
@@ -1795,12 +1795,12 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1795 void **pointers; 1795 void **pointers;
1796 int faila = -1, failb = -1; 1796 int faila = -1, failb = -1;
1797 struct page *page; 1797 struct page *page;
1798 int err; 1798 blk_status_t err;
1799 int i; 1799 int i;
1800 1800
1801 pointers = kcalloc(rbio->real_stripes, sizeof(void *), GFP_NOFS); 1801 pointers = kcalloc(rbio->real_stripes, sizeof(void *), GFP_NOFS);
1802 if (!pointers) { 1802 if (!pointers) {
1803 err = -ENOMEM; 1803 err = BLK_STS_RESOURCE;
1804 goto cleanup_io; 1804 goto cleanup_io;
1805 } 1805 }
1806 1806
@@ -1856,7 +1856,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1856 * a bad data or Q stripe. 1856 * a bad data or Q stripe.
1857 * TODO, we should redo the xor here. 1857 * TODO, we should redo the xor here.
1858 */ 1858 */
1859 err = -EIO; 1859 err = BLK_STS_IOERR;
1860 goto cleanup; 1860 goto cleanup;
1861 } 1861 }
1862 /* 1862 /*
@@ -1882,7 +1882,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1882 if (rbio->bbio->raid_map[failb] == RAID6_Q_STRIPE) { 1882 if (rbio->bbio->raid_map[failb] == RAID6_Q_STRIPE) {
1883 if (rbio->bbio->raid_map[faila] == 1883 if (rbio->bbio->raid_map[faila] ==
1884 RAID5_P_STRIPE) { 1884 RAID5_P_STRIPE) {
1885 err = -EIO; 1885 err = BLK_STS_IOERR;
1886 goto cleanup; 1886 goto cleanup;
1887 } 1887 }
1888 /* 1888 /*
@@ -1954,13 +1954,13 @@ pstripe:
1954 } 1954 }
1955 } 1955 }
1956 1956
1957 err = 0; 1957 err = BLK_STS_OK;
1958cleanup: 1958cleanup:
1959 kfree(pointers); 1959 kfree(pointers);
1960 1960
1961cleanup_io: 1961cleanup_io:
1962 if (rbio->operation == BTRFS_RBIO_READ_REBUILD) { 1962 if (rbio->operation == BTRFS_RBIO_READ_REBUILD) {
1963 if (err == 0) 1963 if (err == BLK_STS_OK)
1964 cache_rbio_pages(rbio); 1964 cache_rbio_pages(rbio);
1965 else 1965 else
1966 clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags); 1966 clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags);
@@ -1968,7 +1968,7 @@ cleanup_io:
1968 rbio_orig_end_io(rbio, err); 1968 rbio_orig_end_io(rbio, err);
1969 } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) { 1969 } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
1970 rbio_orig_end_io(rbio, err); 1970 rbio_orig_end_io(rbio, err);
1971 } else if (err == 0) { 1971 } else if (err == BLK_STS_OK) {
1972 rbio->faila = -1; 1972 rbio->faila = -1;
1973 rbio->failb = -1; 1973 rbio->failb = -1;
1974 1974
@@ -2005,7 +2005,7 @@ static void raid_recover_end_io(struct bio *bio)
2005 return; 2005 return;
2006 2006
2007 if (atomic_read(&rbio->error) > rbio->bbio->max_errors) 2007 if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
2008 rbio_orig_end_io(rbio, -EIO); 2008 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2009 else 2009 else
2010 __raid_recover_end_io(rbio); 2010 __raid_recover_end_io(rbio);
2011} 2011}
@@ -2104,7 +2104,7 @@ out:
2104cleanup: 2104cleanup:
2105 if (rbio->operation == BTRFS_RBIO_READ_REBUILD || 2105 if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
2106 rbio->operation == BTRFS_RBIO_REBUILD_MISSING) 2106 rbio->operation == BTRFS_RBIO_REBUILD_MISSING)
2107 rbio_orig_end_io(rbio, -EIO); 2107 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2108 return -EIO; 2108 return -EIO;
2109} 2109}
2110 2110
@@ -2431,7 +2431,7 @@ submit_write:
2431 nr_data = bio_list_size(&bio_list); 2431 nr_data = bio_list_size(&bio_list);
2432 if (!nr_data) { 2432 if (!nr_data) {
2433 /* Every parity is right */ 2433 /* Every parity is right */
2434 rbio_orig_end_io(rbio, 0); 2434 rbio_orig_end_io(rbio, BLK_STS_OK);
2435 return; 2435 return;
2436 } 2436 }
2437 2437
@@ -2451,7 +2451,7 @@ submit_write:
2451 return; 2451 return;
2452 2452
2453cleanup: 2453cleanup:
2454 rbio_orig_end_io(rbio, -EIO); 2454 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2455} 2455}
2456 2456
2457static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe) 2457static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe)
@@ -2519,7 +2519,7 @@ static void validate_rbio_for_parity_scrub(struct btrfs_raid_bio *rbio)
2519 return; 2519 return;
2520 2520
2521cleanup: 2521cleanup:
2522 rbio_orig_end_io(rbio, -EIO); 2522 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2523} 2523}
2524 2524
2525/* 2525/*
@@ -2633,7 +2633,7 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio)
2633 return; 2633 return;
2634 2634
2635cleanup: 2635cleanup:
2636 rbio_orig_end_io(rbio, -EIO); 2636 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2637 return; 2637 return;
2638 2638
2639finish: 2639finish:
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index e8b9a269fdde..bd679bc7a1a9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6212,8 +6212,8 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical)
6212 } 6212 }
6213} 6213}
6214 6214
6215int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, 6215blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
6216 int mirror_num, int async_submit) 6216 int mirror_num, int async_submit)
6217{ 6217{
6218 struct btrfs_device *dev; 6218 struct btrfs_device *dev;
6219 struct bio *first_bio = bio; 6219 struct bio *first_bio = bio;
@@ -6233,7 +6233,7 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
6233 &map_length, &bbio, mirror_num, 1); 6233 &map_length, &bbio, mirror_num, 1);
6234 if (ret) { 6234 if (ret) {
6235 btrfs_bio_counter_dec(fs_info); 6235 btrfs_bio_counter_dec(fs_info);
6236 return ret; 6236 return errno_to_blk_status(ret);
6237 } 6237 }
6238 6238
6239 total_devs = bbio->num_stripes; 6239 total_devs = bbio->num_stripes;
@@ -6256,7 +6256,7 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
6256 } 6256 }
6257 6257
6258 btrfs_bio_counter_dec(fs_info); 6258 btrfs_bio_counter_dec(fs_info);
6259 return ret; 6259 return errno_to_blk_status(ret);
6260 } 6260 }
6261 6261
6262 if (map_length < length) { 6262 if (map_length < length) {
@@ -6283,7 +6283,7 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
6283 dev_nr, async_submit); 6283 dev_nr, async_submit);
6284 } 6284 }
6285 btrfs_bio_counter_dec(fs_info); 6285 btrfs_bio_counter_dec(fs_info);
6286 return 0; 6286 return BLK_STS_OK;
6287} 6287}
6288 6288
6289struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, 6289struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid,
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 6f45fd60d15a..93277fc60930 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -74,7 +74,7 @@ struct btrfs_device {
74 int missing; 74 int missing;
75 int can_discard; 75 int can_discard;
76 int is_tgtdev_for_dev_replace; 76 int is_tgtdev_for_dev_replace;
77 int last_flush_error; 77 blk_status_t last_flush_error;
78 int flush_bio_sent; 78 int flush_bio_sent;
79 79
80#ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED 80#ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED
@@ -416,8 +416,8 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
416 struct btrfs_fs_info *fs_info, u64 type); 416 struct btrfs_fs_info *fs_info, u64 type);
417void btrfs_mapping_init(struct btrfs_mapping_tree *tree); 417void btrfs_mapping_init(struct btrfs_mapping_tree *tree);
418void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); 418void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
419int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, 419blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
420 int mirror_num, int async_submit); 420 int mirror_num, int async_submit);
421int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, 421int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
422 fmode_t flags, void *holder); 422 fmode_t flags, void *holder);
423int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, 423int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,