diff options
| -rw-r--r-- | drivers/block/rbd.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index fcef63c2c30b..d861c71b4005 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -2194,13 +2194,17 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) | |||
| 2194 | if (result) | 2194 | if (result) |
| 2195 | goto out_err; | 2195 | goto out_err; |
| 2196 | 2196 | ||
| 2197 | /* Allocate the new copyup osd request for the original request */ | 2197 | /* |
| 2198 | 2198 | * The original osd request is of no use to use any more. | |
| 2199 | * We need a new one that can hold the two ops in a copyup | ||
| 2200 | * request. Allocate the new copyup osd request for the | ||
| 2201 | * original request, and release the old one. | ||
| 2202 | */ | ||
| 2199 | result = -ENOMEM; | 2203 | result = -ENOMEM; |
| 2200 | rbd_assert(!orig_request->osd_req); | ||
| 2201 | osd_req = rbd_osd_req_create_copyup(orig_request); | 2204 | osd_req = rbd_osd_req_create_copyup(orig_request); |
| 2202 | if (!osd_req) | 2205 | if (!osd_req) |
| 2203 | goto out_err; | 2206 | goto out_err; |
| 2207 | rbd_osd_req_destroy(orig_request->osd_req); | ||
| 2204 | orig_request->osd_req = osd_req; | 2208 | orig_request->osd_req = osd_req; |
| 2205 | orig_request->copyup_pages = pages; | 2209 | orig_request->copyup_pages = pages; |
| 2206 | orig_request->copyup_page_count = page_count; | 2210 | orig_request->copyup_page_count = page_count; |
| @@ -2277,15 +2281,6 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request) | |||
| 2277 | rbd_assert(rbd_dev->parent != NULL); | 2281 | rbd_assert(rbd_dev->parent != NULL); |
| 2278 | 2282 | ||
| 2279 | /* | 2283 | /* |
| 2280 | * First things first. The original osd request is of no | ||
| 2281 | * use to use any more, we'll need a new one that can hold | ||
| 2282 | * the two ops in a copyup request. We'll get that later, | ||
| 2283 | * but for now we can release the old one. | ||
| 2284 | */ | ||
| 2285 | rbd_osd_req_destroy(obj_request->osd_req); | ||
| 2286 | obj_request->osd_req = NULL; | ||
| 2287 | |||
| 2288 | /* | ||
| 2289 | * Determine the byte range covered by the object in the | 2284 | * Determine the byte range covered by the object in the |
| 2290 | * child image to which the original request was to be sent. | 2285 | * child image to which the original request was to be sent. |
| 2291 | */ | 2286 | */ |
