diff options
author | Alex Elder <elder@inktank.com> | 2013-05-06 18:40:33 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-05-08 21:16:25 -0400 |
commit | 5b2ab72d367d2682c1a237448fbc1595881a88fa (patch) | |
tree | 8a5e066888a1847fe9f22f1be6ced3a0ff90ef32 /drivers/block/rbd.c | |
parent | 91c6febb3817be576785ef06aeaaa8ed423e0a2a (diff) |
rbd: support reading parent page data
Currently, rbd_img_parent_read() assumes the incoming object request
contains bio data. But if a layered image is part of a multi-layer
stack of images it will result in read requests of page data to parent
images.
Fortunately, it's not hard to add support for page data.
This resolves:
http://tracker.ceph.com/issues/4939
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 15ac2a54d4f3..2a0e9b81be48 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -2574,7 +2574,7 @@ static void rbd_img_parent_read(struct rbd_obj_request *obj_request) | |||
2574 | rbd_assert(obj_request_img_data_test(obj_request)); | 2574 | rbd_assert(obj_request_img_data_test(obj_request)); |
2575 | rbd_assert(obj_request->img_request != NULL); | 2575 | rbd_assert(obj_request->img_request != NULL); |
2576 | rbd_assert(obj_request->result == (s32) -ENOENT); | 2576 | rbd_assert(obj_request->result == (s32) -ENOENT); |
2577 | rbd_assert(obj_request->type == OBJ_REQUEST_BIO); | 2577 | rbd_assert(obj_request_type_valid(obj_request->type)); |
2578 | 2578 | ||
2579 | rbd_dev = obj_request->img_request->rbd_dev; | 2579 | rbd_dev = obj_request->img_request->rbd_dev; |
2580 | rbd_assert(rbd_dev->parent != NULL); | 2580 | rbd_assert(rbd_dev->parent != NULL); |
@@ -2590,8 +2590,12 @@ static void rbd_img_parent_read(struct rbd_obj_request *obj_request) | |||
2590 | rbd_obj_request_get(obj_request); | 2590 | rbd_obj_request_get(obj_request); |
2591 | img_request->obj_request = obj_request; | 2591 | img_request->obj_request = obj_request; |
2592 | 2592 | ||
2593 | result = rbd_img_request_fill(img_request, OBJ_REQUEST_BIO, | 2593 | if (obj_request->type == OBJ_REQUEST_BIO) |
2594 | obj_request->bio_list); | 2594 | result = rbd_img_request_fill(img_request, OBJ_REQUEST_BIO, |
2595 | obj_request->bio_list); | ||
2596 | else | ||
2597 | result = rbd_img_request_fill(img_request, OBJ_REQUEST_PAGES, | ||
2598 | obj_request->pages); | ||
2595 | if (result) | 2599 | if (result) |
2596 | goto out_err; | 2600 | goto out_err; |
2597 | 2601 | ||