drbd: merge_bvec_fn: properly remap bvm->bi_bdev
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 10 Nov 2014 16:21:13 +0000 (17:21 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 20 Feb 2015 00:49:24 +0000 (00:49 +0000)
commit 3b9d35d744bb5139f9fed57f38c019bb8c7d351c upstream.

This was not noticed for many years. Affects operation if
md raid is used a backing device for DRBD.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[bwh: Backported to 3.2: s/device/mdev/]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/block/drbd/drbd_req.c

index be984e0..43da226 100644 (file)
@@ -1184,6 +1184,7 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct
                struct request_queue * const b =
                        mdev->ldev->backing_bdev->bd_disk->queue;
                if (b->merge_bvec_fn) {
+                       bvm->bi_bdev = mdev->ldev->backing_bdev;
                        backing_limit = b->merge_bvec_fn(b, bvm, bvec);
                        limit = min(limit, backing_limit);
                }