diff options
author | Dmitry Monakhov <rjevskiy@gmail.com> | 2009-09-19 21:52:25 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-09-23 04:20:15 -0400 |
commit | 1ef04fefe2241087d9db7e9615c3f11b516e36cf (patch) | |
tree | c050718dcdd9f61c698fe6c0247fa0f99b7c4f72 /drivers/md | |
parent | f28f4e272876317626cd399288b4030b627c4b91 (diff) |
md: raid-1/10: fix RW bits manipulation
Recently Jens has changed bio_rw_flagged() logic by following
commit 1f98a13f623e0ef666690a18c1250335fc6d7ef1. Now it returns
bool instead of int. This broke raid1/raid10 RW bits manipulation logic.
One of visible result is BUG_ON triggering due to empty barrier
here scsi_lib.c:1108 scsi_setup_fs_cmnd()
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 10 | ||||
-rw-r--r-- | drivers/md/raid10.c | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a1eb4e13a112..d1b9bd5fd4f6 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -854,7 +854,7 @@ static int make_request(struct request_queue *q, struct bio * bio) | |||
854 | read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; | 854 | read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; |
855 | read_bio->bi_bdev = mirror->rdev->bdev; | 855 | read_bio->bi_bdev = mirror->rdev->bdev; |
856 | read_bio->bi_end_io = raid1_end_read_request; | 856 | read_bio->bi_end_io = raid1_end_read_request; |
857 | read_bio->bi_rw = READ | do_sync; | 857 | read_bio->bi_rw = READ | (do_sync << BIO_RW_SYNCIO); |
858 | read_bio->bi_private = r1_bio; | 858 | read_bio->bi_private = r1_bio; |
859 | 859 | ||
860 | generic_make_request(read_bio); | 860 | generic_make_request(read_bio); |
@@ -946,7 +946,8 @@ static int make_request(struct request_queue *q, struct bio * bio) | |||
946 | mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; | 946 | mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; |
947 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; | 947 | mbio->bi_bdev = conf->mirrors[i].rdev->bdev; |
948 | mbio->bi_end_io = raid1_end_write_request; | 948 | mbio->bi_end_io = raid1_end_write_request; |
949 | mbio->bi_rw = WRITE | do_barriers | do_sync; | 949 | mbio->bi_rw = WRITE | (do_barriers << BIO_RW_BARRIER) | |
950 | (do_sync << BIO_RW_SYNCIO); | ||
950 | mbio->bi_private = r1_bio; | 951 | mbio->bi_private = r1_bio; |
951 | 952 | ||
952 | if (behind_pages) { | 953 | if (behind_pages) { |
@@ -1626,7 +1627,8 @@ static void raid1d(mddev_t *mddev) | |||
1626 | conf->mirrors[i].rdev->data_offset; | 1627 | conf->mirrors[i].rdev->data_offset; |
1627 | bio->bi_bdev = conf->mirrors[i].rdev->bdev; | 1628 | bio->bi_bdev = conf->mirrors[i].rdev->bdev; |
1628 | bio->bi_end_io = raid1_end_write_request; | 1629 | bio->bi_end_io = raid1_end_write_request; |
1629 | bio->bi_rw = WRITE | do_sync; | 1630 | bio->bi_rw = WRITE | |
1631 | (do_sync << BIO_RW_SYNCIO); | ||
1630 | bio->bi_private = r1_bio; | 1632 | bio->bi_private = r1_bio; |
1631 | r1_bio->bios[i] = bio; | 1633 | r1_bio->bios[i] = bio; |
1632 | generic_make_request(bio); | 1634 | generic_make_request(bio); |
@@ -1675,7 +1677,7 @@ static void raid1d(mddev_t *mddev) | |||
1675 | bio->bi_sector = r1_bio->sector + rdev->data_offset; | 1677 | bio->bi_sector = r1_bio->sector + rdev->data_offset; |
1676 | bio->bi_bdev = rdev->bdev; | 1678 | bio->bi_bdev = rdev->bdev; |
1677 | bio->bi_end_io = raid1_end_read_request; | 1679 | bio->bi_end_io = raid1_end_read_request; |
1678 | bio->bi_rw = READ | do_sync; | 1680 | bio->bi_rw = READ | (do_sync << BIO_RW_SYNCIO); |
1679 | bio->bi_private = r1_bio; | 1681 | bio->bi_private = r1_bio; |
1680 | unplug = 1; | 1682 | unplug = 1; |
1681 | generic_make_request(bio); | 1683 | generic_make_request(bio); |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 191f42efecc2..51c4c5c4d87a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -884,7 +884,7 @@ static int make_request(struct request_queue *q, struct bio * bio) | |||
884 | mirror->rdev->data_offset; | 884 | mirror->rdev->data_offset; |
885 | read_bio->bi_bdev = mirror->rdev->bdev; | 885 | read_bio->bi_bdev = mirror->rdev->bdev; |
886 | read_bio->bi_end_io = raid10_end_read_request; | 886 | read_bio->bi_end_io = raid10_end_read_request; |
887 | read_bio->bi_rw = READ | do_sync; | 887 | read_bio->bi_rw = READ | (do_sync << BIO_RW_SYNCIO); |
888 | read_bio->bi_private = r10_bio; | 888 | read_bio->bi_private = r10_bio; |
889 | 889 | ||
890 | generic_make_request(read_bio); | 890 | generic_make_request(read_bio); |
@@ -952,7 +952,7 @@ static int make_request(struct request_queue *q, struct bio * bio) | |||
952 | conf->mirrors[d].rdev->data_offset; | 952 | conf->mirrors[d].rdev->data_offset; |
953 | mbio->bi_bdev = conf->mirrors[d].rdev->bdev; | 953 | mbio->bi_bdev = conf->mirrors[d].rdev->bdev; |
954 | mbio->bi_end_io = raid10_end_write_request; | 954 | mbio->bi_end_io = raid10_end_write_request; |
955 | mbio->bi_rw = WRITE | do_sync; | 955 | mbio->bi_rw = WRITE | (do_sync << BIO_RW_SYNCIO); |
956 | mbio->bi_private = r10_bio; | 956 | mbio->bi_private = r10_bio; |
957 | 957 | ||
958 | atomic_inc(&r10_bio->remaining); | 958 | atomic_inc(&r10_bio->remaining); |
@@ -1625,7 +1625,7 @@ static void raid10d(mddev_t *mddev) | |||
1625 | bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr | 1625 | bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr |
1626 | + rdev->data_offset; | 1626 | + rdev->data_offset; |
1627 | bio->bi_bdev = rdev->bdev; | 1627 | bio->bi_bdev = rdev->bdev; |
1628 | bio->bi_rw = READ | do_sync; | 1628 | bio->bi_rw = READ | (do_sync << BIO_RW_SYNCIO); |
1629 | bio->bi_private = r10_bio; | 1629 | bio->bi_private = r10_bio; |
1630 | bio->bi_end_io = raid10_end_read_request; | 1630 | bio->bi_end_io = raid10_end_read_request; |
1631 | unplug = 1; | 1631 | unplug = 1; |