diff options
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 2e5e4805cbe1..8901f0c8c775 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1282,8 +1282,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio) | |||
1282 | unsigned long flags; | 1282 | unsigned long flags; |
1283 | const int op = bio_op(bio); | 1283 | const int op = bio_op(bio); |
1284 | const unsigned long do_sync = (bio->bi_opf & REQ_SYNC); | 1284 | const unsigned long do_sync = (bio->bi_opf & REQ_SYNC); |
1285 | const unsigned long do_flush_fua = (bio->bi_opf & | 1285 | const unsigned long do_fua = (bio->bi_opf & REQ_FUA); |
1286 | (REQ_PREFLUSH | REQ_FUA)); | ||
1287 | struct md_rdev *blocked_rdev; | 1286 | struct md_rdev *blocked_rdev; |
1288 | struct blk_plug_cb *cb; | 1287 | struct blk_plug_cb *cb; |
1289 | struct raid1_plug_cb *plug = NULL; | 1288 | struct raid1_plug_cb *plug = NULL; |
@@ -1509,7 +1508,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio) | |||
1509 | conf->mirrors[i].rdev->data_offset); | 1508 | conf->mirrors[i].rdev->data_offset); |
1510 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; | 1509 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; |
1511 | mbio->bi_end_io = raid1_end_write_request; | 1510 | mbio->bi_end_io = raid1_end_write_request; |
1512 | bio_set_op_attrs(mbio, op, do_flush_fua | do_sync); | 1511 | bio_set_op_attrs(mbio, op, do_fua | do_sync); |
1513 | if (test_bit(FailFast, &conf->mirrors[i].rdev->flags) && | 1512 | if (test_bit(FailFast, &conf->mirrors[i].rdev->flags) && |
1514 | !test_bit(WriteMostly, &conf->mirrors[i].rdev->flags) && | 1513 | !test_bit(WriteMostly, &conf->mirrors[i].rdev->flags) && |
1515 | conf->raid_disks - mddev->degraded > 1) | 1514 | conf->raid_disks - mddev->degraded > 1) |
@@ -1565,6 +1564,11 @@ static void raid1_make_request(struct mddev *mddev, struct bio *bio) | |||
1565 | struct bio *split; | 1564 | struct bio *split; |
1566 | sector_t sectors; | 1565 | sector_t sectors; |
1567 | 1566 | ||
1567 | if (unlikely(bio->bi_opf & REQ_PREFLUSH)) { | ||
1568 | md_flush_request(mddev, bio); | ||
1569 | return; | ||
1570 | } | ||
1571 | |||
1568 | /* if bio exceeds barrier unit boundary, split it */ | 1572 | /* if bio exceeds barrier unit boundary, split it */ |
1569 | do { | 1573 | do { |
1570 | sectors = align_to_barrier_unit_end( | 1574 | sectors = align_to_barrier_unit_end( |