From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 2/5] rbd: don't release write request until necessary
Date: Sat, 11 May 2013 12:44:02 -0500 [thread overview]
Message-ID: <518E8362.30906@inktank.com> (raw)
In-Reply-To: <518E831E.6000206@inktank.com>
Previously when a layered write was going to involve a copyup
request, the original osd request was released before submitting the
parent full-object read. The osd request for the copyup would then
be allocated in rbd_img_obj_parent_read_full_callback().
Shortly we will be handling the event of mapped layered images
getting flattened, and when that occurs we need to resubmit the
original request. We therefore don't want to release the osd
request until we really konw we're going to replace it--in the
callback function.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 06d49b5..ac3f4e7 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2187,13 +2187,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;
@@ -2269,15 +2273,6 @@ static int rbd_img_obj_parent_read_full(struct
rbd_obj_request *obj_request)
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.
*/
--
1.7.9.5
next prev parent reply other threads:[~2013-05-11 17:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-11 17:42 [PATCH 0/5] rbd: prep work for flattening images Alex Elder
2013-05-11 17:43 ` [PATCH 1/5] rbd: get parent info on refresh Alex Elder
2013-05-11 20:59 ` Josh Durgin
2013-05-11 21:52 ` Alex Elder
2013-05-13 17:58 ` [PATCH 1/5, v2] " Alex Elder
2013-05-13 19:34 ` Josh Durgin
2013-05-11 17:44 ` Alex Elder [this message]
2013-05-11 17:44 ` [PATCH 3/5] rbd: define rbd_dev_unparent() Alex Elder
2013-05-11 17:44 ` [PATCH 4/5] rbd: define parent image request routines Alex Elder
2013-05-11 17:44 ` [PATCH 5/5] rbd: reference count parent requests Alex Elder
2013-05-11 21:08 ` [PATCH 0/5] rbd: prep work for flattening images Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518E8362.30906@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.