diff options
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r-- | fs/btrfs/raid56.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index cbc416204452..5264858ed768 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c | |||
@@ -994,10 +994,12 @@ static struct btrfs_raid_bio *alloc_rbio(struct btrfs_root *root, | |||
994 | rbio->bio_pages = p + sizeof(struct page *) * num_pages; | 994 | rbio->bio_pages = p + sizeof(struct page *) * num_pages; |
995 | rbio->dbitmap = p + sizeof(struct page *) * num_pages * 2; | 995 | rbio->dbitmap = p + sizeof(struct page *) * num_pages * 2; |
996 | 996 | ||
997 | if (bbio->raid_map[real_stripes - 1] == RAID6_Q_STRIPE) | 997 | if (bbio->map_type & BTRFS_BLOCK_GROUP_RAID5) |
998 | nr_data = real_stripes - 1; | ||
999 | else if (bbio->map_type & BTRFS_BLOCK_GROUP_RAID6) | ||
998 | nr_data = real_stripes - 2; | 1000 | nr_data = real_stripes - 2; |
999 | else | 1001 | else |
1000 | nr_data = real_stripes - 1; | 1002 | BUG(); |
1001 | 1003 | ||
1002 | rbio->nr_data = nr_data; | 1004 | rbio->nr_data = nr_data; |
1003 | return rbio; | 1005 | return rbio; |
@@ -1850,9 +1852,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio) | |||
1850 | } | 1852 | } |
1851 | 1853 | ||
1852 | /* all raid6 handling here */ | 1854 | /* all raid6 handling here */ |
1853 | if (rbio->bbio->raid_map[rbio->real_stripes - 1] == | 1855 | if (rbio->bbio->map_type & BTRFS_BLOCK_GROUP_RAID6) { |
1854 | RAID6_Q_STRIPE) { | ||
1855 | |||
1856 | /* | 1856 | /* |
1857 | * single failure, rebuild from parity raid5 | 1857 | * single failure, rebuild from parity raid5 |
1858 | * style | 1858 | * style |