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 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: