From 0dcd31e501da1595fed136264dd59aa29e6ff3eb Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Thu, 9 May 2013 10:08:49 -0500 Subject: [PATCH] --- yaml --- r: 375609 b: refs/heads/master c: 8785b1d487f0a31afd2c802499786d3b355eccea h: refs/heads/master i: 375607: fed14519956019065b858b0505dc54190979cce0 v: v3 --- [refs] | 2 +- trunk/drivers/block/rbd.c | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index b0693d8ceebb..3e51515ff0ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 642a25375f4c863607d2170f4471aec8becf7788 +refs/heads/master: 8785b1d487f0a31afd2c802499786d3b355eccea diff --git a/trunk/drivers/block/rbd.c b/trunk/drivers/block/rbd.c index fcef63c2c30b..d861c71b4005 100644 --- a/trunk/drivers/block/rbd.c +++ b/trunk/drivers/block/rbd.c @@ -2194,13 +2194,17 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) if (result) goto out_err; - /* Allocate the new copyup osd request for the original request */ - + /* + * The original osd request is of no use to use any more. + * We need a new one that can hold the two ops in a copyup + * request. Allocate the new copyup osd request for the + * original request, and release the old one. + */ result = -ENOMEM; - rbd_assert(!orig_request->osd_req); osd_req = rbd_osd_req_create_copyup(orig_request); if (!osd_req) goto out_err; + rbd_osd_req_destroy(orig_request->osd_req); orig_request->osd_req = osd_req; orig_request->copyup_pages = pages; orig_request->copyup_page_count = page_count; @@ -2276,15 +2280,6 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request) rbd_dev = img_request->rbd_dev; rbd_assert(rbd_dev->parent != NULL); - /* - * First things first. The original osd request is of no - * use to use any more, we'll need a new one that can hold - * the two ops in a copyup request. We'll get that later, - * but for now we can release the old one. - */ - rbd_osd_req_destroy(obj_request->osd_req); - obj_request->osd_req = NULL; - /* * Determine the byte range covered by the object in the * child image to which the original request was to be sent.