Re: [PATCH] rbd: enforce parent overlap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/22/2013 01:34 PM, Josh Durgin wrote:
> Alex Elder <elder@xxxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux