|
@@ -1282,8 +1282,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio)
|
|
|
unsigned long flags;
|
|
|
const int op = bio_op(bio);
|
|
|
const unsigned long do_sync = (bio->bi_opf & REQ_SYNC);
|
|
|
- const unsigned long do_flush_fua = (bio->bi_opf &
|
|
|
- (REQ_PREFLUSH | REQ_FUA));
|
|
|
+ const unsigned long do_fua = (bio->bi_opf & REQ_FUA);
|
|
|
struct md_rdev *blocked_rdev;
|
|
|
struct blk_plug_cb *cb;
|
|
|
struct raid1_plug_cb *plug = NULL;
|
|
@@ -1509,7 +1508,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio)
|
|
|
conf->mirrors[i].rdev->data_offset);
|
|
|
mbio->bi_bdev = conf->mirrors[i].rdev->bdev;
|
|
|
mbio->bi_end_io = raid1_end_write_request;
|
|
|
- bio_set_op_attrs(mbio, op, do_flush_fua | do_sync);
|
|
|
+ bio_set_op_attrs(mbio, op, do_fua | do_sync);
|
|
|
if (test_bit(FailFast, &conf->mirrors[i].rdev->flags) &&
|
|
|
!test_bit(WriteMostly, &conf->mirrors[i].rdev->flags) &&
|
|
|
conf->raid_disks - mddev->degraded > 1)
|
|
@@ -1565,6 +1564,11 @@ static void raid1_make_request(struct mddev *mddev, struct bio *bio)
|
|
|
struct bio *split;
|
|
|
sector_t sectors;
|
|
|
|
|
|
+ if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
|
|
|
+ md_flush_request(mddev, bio);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
/* if bio exceeds barrier unit boundary, split it */
|
|
|
do {
|
|
|
sectors = align_to_barrier_unit_end(
|