summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/raid56.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r--fs/btrfs/raid56.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index d268cb633735..24a62224b24b 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) ?
@@ -1325,7 +1325,7 @@ write_data:
1325 return; 1325 return;
1326 1326
1327cleanup: 1327cleanup:
1328 rbio_orig_end_io(rbio, -EIO); 1328 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1329} 1329}
1330 1330
1331/* 1331/*
@@ -1477,7 +1477,7 @@ static void raid_rmw_end_io(struct bio *bio)
1477 1477
1478cleanup: 1478cleanup:
1479 1479
1480 rbio_orig_end_io(rbio, -EIO); 1480 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1481} 1481}
1482 1482
1483static void async_rmw_stripe(struct btrfs_raid_bio *rbio) 1483static void async_rmw_stripe(struct btrfs_raid_bio *rbio)
@@ -1581,7 +1581,7 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio)
1581 return 0; 1581 return 0;
1582 1582
1583cleanup: 1583cleanup:
1584 rbio_orig_end_io(rbio, -EIO); 1584 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1585 return -EIO; 1585 return -EIO;
1586 1586
1587finish: 1587finish:
@@ -1797,12 +1797,12 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1797 void **pointers; 1797 void **pointers;
1798 int faila = -1, failb = -1; 1798 int faila = -1, failb = -1;
1799 struct page *page; 1799 struct page *page;
1800 int err; 1800 blk_status_t err;
1801 int i; 1801 int i;
1802 1802
1803 pointers = kcalloc(rbio->real_stripes, sizeof(void *), GFP_NOFS); 1803 pointers = kcalloc(rbio->real_stripes, sizeof(void *), GFP_NOFS);
1804 if (!pointers) { 1804 if (!pointers) {
1805 err = -ENOMEM; 1805 err = BLK_STS_RESOURCE;
1806 goto cleanup_io; 1806 goto cleanup_io;
1807 } 1807 }
1808 1808
@@ -1858,7 +1858,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1858 * a bad data or Q stripe. 1858 * a bad data or Q stripe.
1859 * TODO, we should redo the xor here. 1859 * TODO, we should redo the xor here.
1860 */ 1860 */
1861 err = -EIO; 1861 err = BLK_STS_IOERR;
1862 goto cleanup; 1862 goto cleanup;
1863 } 1863 }
1864 /* 1864 /*
@@ -1884,7 +1884,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
1884 if (rbio->bbio->raid_map[failb] == RAID6_Q_STRIPE) { 1884 if (rbio->bbio->raid_map[failb] == RAID6_Q_STRIPE) {
1885 if (rbio->bbio->raid_map[faila] == 1885 if (rbio->bbio->raid_map[faila] ==
1886 RAID5_P_STRIPE) { 1886 RAID5_P_STRIPE) {
1887 err = -EIO; 1887 err = BLK_STS_IOERR;
1888 goto cleanup; 1888 goto cleanup;
1889 } 1889 }
1890 /* 1890 /*
@@ -1956,13 +1956,13 @@ pstripe:
1956 } 1956 }
1957 } 1957 }
1958 1958
1959 err = 0; 1959 err = BLK_STS_OK;
1960cleanup: 1960cleanup:
1961 kfree(pointers); 1961 kfree(pointers);
1962 1962
1963cleanup_io: 1963cleanup_io:
1964 if (rbio->operation == BTRFS_RBIO_READ_REBUILD) { 1964 if (rbio->operation == BTRFS_RBIO_READ_REBUILD) {
1965 if (err == 0) 1965 if (err == BLK_STS_OK)
1966 cache_rbio_pages(rbio); 1966 cache_rbio_pages(rbio);
1967 else 1967 else
1968 clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags); 1968 clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags);
@@ -1970,7 +1970,7 @@ cleanup_io:
1970 rbio_orig_end_io(rbio, err); 1970 rbio_orig_end_io(rbio, err);
1971 } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) { 1971 } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
1972 rbio_orig_end_io(rbio, err); 1972 rbio_orig_end_io(rbio, err);
1973 } else if (err == 0) { 1973 } else if (err == BLK_STS_OK) {
1974 rbio->faila = -1; 1974 rbio->faila = -1;
1975 rbio->failb = -1; 1975 rbio->failb = -1;
1976 1976
@@ -2007,7 +2007,7 @@ static void raid_recover_end_io(struct bio *bio)
2007 return; 2007 return;
2008 2008
2009 if (atomic_read(&rbio->error) > rbio->bbio->max_errors) 2009 if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
2010 rbio_orig_end_io(rbio, -EIO); 2010 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2011 else 2011 else
2012 __raid_recover_end_io(rbio); 2012 __raid_recover_end_io(rbio);
2013} 2013}
@@ -2106,7 +2106,7 @@ out:
2106cleanup: 2106cleanup:
2107 if (rbio->operation == BTRFS_RBIO_READ_REBUILD || 2107 if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
2108 rbio->operation == BTRFS_RBIO_REBUILD_MISSING) 2108 rbio->operation == BTRFS_RBIO_REBUILD_MISSING)
2109 rbio_orig_end_io(rbio, -EIO); 2109 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2110 return -EIO; 2110 return -EIO;
2111} 2111}
2112 2112
@@ -2433,7 +2433,7 @@ submit_write:
2433 nr_data = bio_list_size(&bio_list); 2433 nr_data = bio_list_size(&bio_list);
2434 if (!nr_data) { 2434 if (!nr_data) {
2435 /* Every parity is right */ 2435 /* Every parity is right */
2436 rbio_orig_end_io(rbio, 0); 2436 rbio_orig_end_io(rbio, BLK_STS_OK);
2437 return; 2437 return;
2438 } 2438 }
2439 2439
@@ -2453,7 +2453,7 @@ submit_write:
2453 return; 2453 return;
2454 2454
2455cleanup: 2455cleanup:
2456 rbio_orig_end_io(rbio, -EIO); 2456 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2457} 2457}
2458 2458
2459static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe) 2459static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe)
@@ -2521,7 +2521,7 @@ static void validate_rbio_for_parity_scrub(struct btrfs_raid_bio *rbio)
2521 return; 2521 return;
2522 2522
2523cleanup: 2523cleanup:
2524 rbio_orig_end_io(rbio, -EIO); 2524 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2525} 2525}
2526 2526
2527/* 2527/*
@@ -2635,7 +2635,7 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio)
2635 return; 2635 return;
2636 2636
2637cleanup: 2637cleanup:
2638 rbio_orig_end_io(rbio, -EIO); 2638 rbio_orig_end_io(rbio, BLK_STS_IOERR);
2639 return; 2639 return;
2640 2640
2641finish: 2641finish: