All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] rbd: enforce parent overlap
Date: Mon, 22 Apr 2013 13:46:44 -0700	[thread overview]
Message-ID: <5175A1B4.30008@inktank.com> (raw)
In-Reply-To: <5175A0E4.5090201@inktank.com>

On 04/22/2013 01:43 PM, Alex Elder wrote:
> On 04/22/2013 01:34 PM, Josh Durgin wrote:
>>> +     * We need to zero anything beyond the parent overlap
>>> +     * boundary.  Since rbd_img_obj_request_read_callback()
>>> +     * will zero anything beyond the end of a short read, an
>>> +     * easy way to do this is to pretend the data from the
>>> +     * parent came up short--ending at the overlap boundary.
>>> +     */
>
> Sorry, I missed this one.
>
>>> +    rbd_assert(obj_request->img_offset < U64_MAX - obj_request->length);
>>> +    obj_end = obj_request->img_offset + obj_request->length;
>>> +    rbd_dev = obj_request->img_request->rbd_dev;
>>> +    if (obj_end > rbd_dev->parent_overlap) {
>>
>> Shouldn't this be >=, since the overlap is a size?
>
> Does the overlap define the maximum byte offste included in
> the overlap, or does it define the first offset not included?
>
> If it's the former, then I agree with you (and it's not
> what I thought).

It's the latter. Now I see that obj_end is the first offset not 
included, so it's correct in your patch.

> 					-Alex
>
>>> +        u64 xferred = 0;
>>> +
>>> +        if (obj_request->img_offset < rbd_dev->parent_overlap)
>>> +            xferred = rbd_dev->parent_overlap -
>>> +                    obj_request->img_offset;
>>> +
>>> +        obj_request->xferred = min(img_request->xferred, xferred);
>>> +    } else {


      reply	other threads:[~2013-04-22 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-21  5:34 [PATCH] rbd: enforce parent overlap Alex Elder
2013-04-22 18:34 ` Josh Durgin
2013-04-22 19:33   ` Alex Elder
2013-04-22 20:33     ` Josh Durgin
2013-04-22 20:43   ` Alex Elder
2013-04-22 20:46     ` Josh Durgin [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=5175A1B4.30008@inktank.com \
    --to=josh.durgin@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@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.