All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: Josh Durgin <josh.durgin@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] rbd: enforce parent overlap
Date: Mon, 22 Apr 2013 14:33:51 -0500	[thread overview]
Message-ID: <5175909F.6020307@inktank.com> (raw)
In-Reply-To: <517582C1.2020809@inktank.com>

On 04/22/2013 01:34 PM, Josh Durgin wrote:
> Alex Elder <elder@inktank.com> wrote:
> 
>> (This patch is available in branch "review/wip-overlap" of
>> the ceph-client git repository.)
>>
>>
>>
>> A clone image has a defined overlap point with its parent image.
>> That is the byte offset beyond which the parent image has no
>> defined data to back the clone, and anything thereafter can be
>> viewed as being zero-filled by the clone image.

. . .

>> @@ -2166,6 +2166,16 @@ static int rbd_img_obj_parent_read_full(struct
>> rbd_obj_request *obj_request)
>>     length = (u64)1 << rbd_dev->header.obj_order;
>>
>>     /*
>> +     * There is no defined parent data beyond the parent
>> +     * overlap, so limit what we read at that boundary if
>> +     * necessary.
>> +     */
>> +    if (img_offset + length > rbd_dev->parent_overlap) {
>> +        rbd_assert(img_offset < rbd_dev->parent_overlap);
>> +        length = obj_request->offset - obj_request->img_offset;
> 
> This doesn't look right. I think we want the length to be
> rbd_dev->parent_overlap - img_offset.

You are correct.  I'm glad you spotted that.

The assertion above it was right, I must have forgotten
to fix the actual assignment.

Is that the only problem you see?  I can repost, but if
I agree to fix it as you describe, is that sufficient?

					-Alex


>> +    }
>> +
>> +    /*
>>      * Allocate a page array big enough to receive the data read
>>      * from the parent.


  reply	other threads:[~2013-04-22 19:33 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 [this message]
2013-04-22 20:33     ` Josh Durgin
2013-04-22 20:43   ` Alex Elder
2013-04-22 20:46     ` 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=5175909F.6020307@inktank.com \
    --to=elder@inktank.com \
    --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.