diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-08-25 04:21:04 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-23 07:01:45 -0400 |
commit | a8a4e51e6965db84d2af041370ea2ab6232aa4f1 (patch) | |
tree | 74f1301712fa631faf6c39337bced33060ca5038 /drivers/block/drbd | |
parent | 2451fc3b2bd3a7205270da75a21dde0d5d7c96a2 (diff) |
drbd: REQ_HARDBARRIER -> REQ_FUA transition for meta data accesses
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_actlog.c | 16 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 7 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 4 |
3 files changed, 7 insertions, 20 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index bd925180a2b0..ba95cba192be 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c | |||
@@ -78,11 +78,10 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev, | |||
78 | init_completion(&md_io.event); | 78 | init_completion(&md_io.event); |
79 | md_io.error = 0; | 79 | md_io.error = 0; |
80 | 80 | ||
81 | if ((rw & WRITE) && !test_bit(MD_NO_BARRIER, &mdev->flags)) | 81 | if ((rw & WRITE) && !test_bit(MD_NO_FUA, &mdev->flags)) |
82 | rw |= REQ_HARDBARRIER; | 82 | rw |= REQ_FUA; |
83 | rw |= REQ_UNPLUG | REQ_SYNC; | 83 | rw |= REQ_UNPLUG | REQ_SYNC; |
84 | 84 | ||
85 | retry: | ||
86 | bio = bio_alloc(GFP_NOIO, 1); | 85 | bio = bio_alloc(GFP_NOIO, 1); |
87 | bio->bi_bdev = bdev->md_bdev; | 86 | bio->bi_bdev = bdev->md_bdev; |
88 | bio->bi_sector = sector; | 87 | bio->bi_sector = sector; |
@@ -100,17 +99,6 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev, | |||
100 | wait_for_completion(&md_io.event); | 99 | wait_for_completion(&md_io.event); |
101 | ok = bio_flagged(bio, BIO_UPTODATE) && md_io.error == 0; | 100 | ok = bio_flagged(bio, BIO_UPTODATE) && md_io.error == 0; |
102 | 101 | ||
103 | /* check for unsupported barrier op. | ||
104 | * would rather check on EOPNOTSUPP, but that is not reliable. | ||
105 | * don't try again for ANY return value != 0 */ | ||
106 | if (unlikely((bio->bi_rw & REQ_HARDBARRIER) && !ok)) { | ||
107 | /* Try again with no barrier */ | ||
108 | dev_warn(DEV, "Barriers not supported on meta data device - disabling\n"); | ||
109 | set_bit(MD_NO_BARRIER, &mdev->flags); | ||
110 | rw &= ~REQ_HARDBARRIER; | ||
111 | bio_put(bio); | ||
112 | goto retry; | ||
113 | } | ||
114 | out: | 102 | out: |
115 | bio_put(bio); | 103 | bio_put(bio); |
116 | return ok; | 104 | return ok; |
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 1b915fd9278f..575bfba1b0da 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -835,8 +835,7 @@ enum { | |||
835 | NO_BARRIER_SUPP, /* underlying block device doesn't implement barriers */ | 835 | NO_BARRIER_SUPP, /* underlying block device doesn't implement barriers */ |
836 | CONSIDER_RESYNC, | 836 | CONSIDER_RESYNC, |
837 | 837 | ||
838 | MD_NO_BARRIER, /* meta data device does not support barriers, | 838 | MD_NO_FUA, /* Users wants us to not use FUA/FLUSH on meta data dev */ |
839 | so don't even try */ | ||
840 | SUSPEND_IO, /* suspend application io */ | 839 | SUSPEND_IO, /* suspend application io */ |
841 | BITMAP_IO, /* suspend application io; | 840 | BITMAP_IO, /* suspend application io; |
842 | once no more io in flight, start bitmap io */ | 841 | once no more io in flight, start bitmap io */ |
@@ -2404,13 +2403,13 @@ static inline void drbd_md_flush(struct drbd_conf *mdev) | |||
2404 | { | 2403 | { |
2405 | int r; | 2404 | int r; |
2406 | 2405 | ||
2407 | if (test_bit(MD_NO_BARRIER, &mdev->flags)) | 2406 | if (test_bit(MD_NO_FUA, &mdev->flags)) |
2408 | return; | 2407 | return; |
2409 | 2408 | ||
2410 | r = blkdev_issue_flush(mdev->ldev->md_bdev, GFP_KERNEL, NULL, | 2409 | r = blkdev_issue_flush(mdev->ldev->md_bdev, GFP_KERNEL, NULL, |
2411 | BLKDEV_IFL_WAIT); | 2410 | BLKDEV_IFL_WAIT); |
2412 | if (r) { | 2411 | if (r) { |
2413 | set_bit(MD_NO_BARRIER, &mdev->flags); | 2412 | set_bit(MD_NO_FUA, &mdev->flags); |
2414 | dev_err(DEV, "meta data flush failed with status %d, disabling md-flushes\n", r); | 2413 | dev_err(DEV, "meta data flush failed with status %d, disabling md-flushes\n", r); |
2415 | } | 2414 | } |
2416 | } | 2415 | } |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 899878fcf97d..29e5c70e4e26 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1103,9 +1103,9 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp | |||
1103 | /* Reset the "barriers don't work" bits here, then force meta data to | 1103 | /* Reset the "barriers don't work" bits here, then force meta data to |
1104 | * be written, to ensure we determine if barriers are supported. */ | 1104 | * be written, to ensure we determine if barriers are supported. */ |
1105 | if (nbc->dc.no_md_flush) | 1105 | if (nbc->dc.no_md_flush) |
1106 | set_bit(MD_NO_BARRIER, &mdev->flags); | 1106 | set_bit(MD_NO_FUA, &mdev->flags); |
1107 | else | 1107 | else |
1108 | clear_bit(MD_NO_BARRIER, &mdev->flags); | 1108 | clear_bit(MD_NO_FUA, &mdev->flags); |
1109 | 1109 | ||
1110 | /* Point of no return reached. | 1110 | /* Point of no return reached. |
1111 | * Devices and memory are no longer released by error cleanup below. | 1111 | * Devices and memory are no longer released by error cleanup below. |