From: Alex Elder <alex.elder@linaro.org>
To: Josh Durgin <josh.durgin@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] rbd: fetch object order before using it
Date: Sat, 15 Jun 2013 12:05:16 -0500 [thread overview]
Message-ID: <51BC9ECC.3020809@linaro.org> (raw)
In-Reply-To: <1371093046-5814-1-git-send-email-josh.durgin@inktank.com>
On 06/12/2013 10:10 PM, Josh Durgin wrote:
> 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>
Looks good.
Reviewed-by: Alex Elder <elder@linaro.org>
> ---
> 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;
>
prev parent reply other threads:[~2013-06-15 17:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=51BC9ECC.3020809@linaro.org \
--to=alex.elder@linaro.org \
--cc=ceph-devel@vger.kernel.org \
--cc=josh.durgin@inktank.com \
/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.