All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rbd: fetch object order before using it
@ 2013-06-13  3:10 Josh Durgin
  2013-06-13  3:10 ` [PATCH 2/2] rbd: use the correct length for format 2 object names Josh Durgin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Josh Durgin @ 2013-06-13  3:10 UTC (permalink / raw)
  To: ceph-devel

rbd_dev_v2_header_onetime() fetches striping information, and
checks whether the image can be read by compariing the stripe unit
to the object size. It determines the object size by shifting
the object order, which is 0 at this point since it has not been
read yet. Move the call to get the image size and object order
before rbd_dev_v2_header_onetime() so it is set before use.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
---
 drivers/block/rbd.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index cecf5c6..9f72125 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4286,6 +4286,10 @@ static int rbd_dev_v2_header_info(struct rbd_device *rbd_dev)
 	bool first_time = rbd_dev->header.object_prefix == NULL;
 	int ret;
 
+	ret = rbd_dev_v2_image_size(rbd_dev);
+	if (ret)
+		return ret;
+
 	if (first_time) {
 		ret = rbd_dev_v2_header_onetime(rbd_dev);
 		if (ret)
@@ -4319,10 +4323,6 @@ static int rbd_dev_v2_header_info(struct rbd_device *rbd_dev)
 					"is EXPERIMENTAL!");
 	}
 
-	ret = rbd_dev_v2_image_size(rbd_dev);
-	if (ret)
-		return ret;
-
 	if (rbd_dev->spec->snap_id == CEPH_NOSNAP)
 		if (rbd_dev->mapping.size != rbd_dev->header.image_size)
 			rbd_dev->mapping.size = rbd_dev->header.image_size;
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-15 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13  3:10 [PATCH 1/2] rbd: fetch object order before using it Josh Durgin
2013-06-13  3:10 ` [PATCH 2/2] rbd: use the correct length for format 2 object names Josh Durgin
2013-06-15 17:05   ` Alex Elder
2013-06-13 15:52 ` [PATCH 1/2] rbd: fetch object order before using it Sage Weil
2013-06-15 17:05 ` Alex Elder

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.