130
130
static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt)
132
bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 16);
132
bio->bi_phys_segments = raid5_bi_phys_segments(bio) | (cnt << 16);
135
135
/* Find first data disk in a raid6 stripe */
548
548
bi->bi_io_vec[0].bv_offset = 0;
549
549
bi->bi_size = STRIPE_SIZE;
550
550
bi->bi_next = NULL;
552
552
test_bit(R5_ReWrite, &sh->dev[i].flags))
553
553
atomic_add(STRIPE_SECTORS,
554
554
&rdev->corrected_errors);
555
555
generic_make_request(bi);
558
558
set_bit(STRIPE_DEGRADED, &sh->state);
559
559
pr_debug("skip op %ld on disc %d for sector %llu\n",
560
560
bi->bi_rw, i, (unsigned long long)sh->sector);
585
585
init_async_submit(&submit, flags, tx, NULL, NULL, NULL);
587
587
bio_for_each_segment(bvl, bio, i) {
588
int len = bio_iovec_idx(bio, i)->bv_len;
588
int len = bvl->bv_len;
590
590
int b_offset = 0;
604
b_offset += bio_iovec_idx(bio, i)->bv_offset;
605
bio_page = bio_iovec_idx(bio, i)->bv_page;
604
b_offset += bvl->bv_offset;
605
bio_page = bvl->bv_page;
607
607
tx = async_memcpy(page, bio_page, page_offset,
608
608
b_offset, clen, &submit);
1700
1700
raid5_conf_t *conf = mddev->private;
1701
1701
pr_debug("raid456: error called\n");
1703
if (!test_bit(Faulty, &rdev->flags)) {
1704
set_bit(MD_CHANGE_DEVS, &mddev->flags);
1705
if (test_and_clear_bit(In_sync, &rdev->flags)) {
1706
unsigned long flags;
1707
spin_lock_irqsave(&conf->device_lock, flags);
1709
spin_unlock_irqrestore(&conf->device_lock, flags);
1711
* if recovery was running, make sure it aborts.
1713
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
1715
set_bit(Faulty, &rdev->flags);
1717
"md/raid:%s: Disk failure on %s, disabling device.\n"
1718
"md/raid:%s: Operation continuing on %d devices.\n",
1720
bdevname(rdev->bdev, b),
1722
conf->raid_disks - mddev->degraded);
1703
if (test_and_clear_bit(In_sync, &rdev->flags)) {
1704
unsigned long flags;
1705
spin_lock_irqsave(&conf->device_lock, flags);
1707
spin_unlock_irqrestore(&conf->device_lock, flags);
1709
* if recovery was running, make sure it aborts.
1711
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
1713
set_bit(Faulty, &rdev->flags);
1714
set_bit(MD_CHANGE_DEVS, &mddev->flags);
1716
"md/raid:%s: Disk failure on %s, disabling device.\n"
1717
"md/raid:%s: Operation continuing on %d devices.\n",
1719
bdevname(rdev->bdev, b),
1721
conf->raid_disks - mddev->degraded);
3960
3958
/* spinlock is needed as reshape_progress may be
3961
3959
* 64bit on a 32bit platform, and so it might be
3962
3960
* possible to see a half-updated value
3963
* Ofcourse reshape_progress could change after
3961
* Of course reshape_progress could change after
3964
3962
* the lock is dropped, so once we get a reference
3965
3963
* to the stripe that we think it is, we will have
3966
3964
* to check again.
4860
4858
printk(KERN_INFO "md/raid:%s: device %s operational as raid"
4862
4860
mdname(mddev), bdevname(rdev->bdev, b), raid_disk);
4861
} else if (rdev->saved_raid_disk != raid_disk)
4864
4862
/* Cannot rely on bitmap to complete recovery */
4865
4863
conf->fullsync = 1;
5391
5389
return -EINVAL;
5392
5390
set_capacity(mddev->gendisk, mddev->array_sectors);
5393
5391
revalidate_disk(mddev->gendisk);
5394
if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) {
5392
if (sectors > mddev->dev_sectors &&
5393
mddev->recovery_cp > mddev->dev_sectors) {
5395
5394
mddev->recovery_cp = mddev->dev_sectors;
5396
5395
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);