CEPH filesystem development
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Ilya Dryomov <ilya.dryomov@inktank.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH 6/8] rbd: update mapping size only on refresh
Date: Fri, 25 Jul 2014 08:31:46 -0500	[thread overview]
Message-ID: <53D25C42.4080807@ieee.org> (raw)
In-Reply-To: <CALFYKtB1HZow3SDZxryWdyAmF8Vj1WYSTf5BQB4MkaVhgxrBgg@mail.gmail.com>

On 07/24/2014 10:10 AM, Ilya Dryomov wrote:
> On Thu, Jul 24, 2014 at 5:46 PM, Ilya Dryomov <ilya.dryomov@inktank.com> wrote:
>> On Thu, Jul 24, 2014 at 5:25 PM, Alex Elder <elder@ieee.org> wrote:
>>> On 07/24/2014 03:42 AM, Ilya Dryomov wrote:
>>>> There is no sense in trying to update the mapping size before it's even
>>>> been set.
>>>
>>> It took me a bit to follow this.  But basically there is
>>> no mapping unless it's mapped.  So previously this was
>>> updating the mapping information even for unmapped
>>> parent (or other) images.  There's no need to update
>>> the mapping size for a snapshot--it'll never change.
>>>
>>> Is that right?  If not, please advise; otherwise:
>>
>> No.  Previously it was updating the mapping size both on the inital map
>> and on refresh (of the base image).  Doing that on the inital map
>> doesn't make sense: not only struct rbd_mapping fields aren't properly
>> initialized at that point - rbd_dev_mapping_set() is called much later
>> in the map sequence, snap_id isn't initialized either (at least in the
>> format 2 case, I haven't looked too closely at the format 1 case).  And
>> just in general, trying to update something before it had a chance to
>> change is bogus..
> 
> BTW, while we are on the subject of struct rbd_mapping, is there any
> particular reason to keep around both the base image values and actual
> mapping values?  I am tempted to change the mapping sequence so that 1)
> snap context is read in immediately after watch setup, before anything
> else is done, 2) supplied snap name is resolved into an id and 3) the
> actual (i.e. based on snap_id) mapping size, features, parent_overlap,
> etc are read in directly into struct rbd_image_header.  That would
> allow to rip struct rbd_mapping entirely and make the code more clear.

The rbd_mapping structure started out well-intentioned but
over time it seems clear it hasn't added the value it was
intended to add.  Here's where it got created:
    f84344f rbd: separate mapping info in rbd_dev
The only original field that survives is read_only.  There's
no harm at all in just moving the fields in that structure
out into the rbd_device structure.

Preserving the base image size in the header structure is
an artifact of the version 1 code, where it held the last
version of the on-disk header data.  The version 2 code
maintains it for consistency.

You could eliminate that I suppose.  I think the result
would require rbd_header_from_disk() to know about the
mapping rather than doing a simple conversion of data
from one form to another.

I say try it, and if you like the result I probably will too...

					-Alex


> Thanks,
> 
>                 Ilya
> 


  reply	other threads:[~2014-07-25 13:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24  8:42 [PATCH 0/8] wip-overlap Ilya Dryomov
2014-07-24  8:42 ` [PATCH 1/8] rbd: show the entire chain of parent images Ilya Dryomov
2014-07-24 12:31   ` Alex Elder
2014-07-24 12:45     ` Ilya Dryomov
2014-07-24  8:42 ` [PATCH 2/8] rbd: introduce rbd_dev_header_info() Ilya Dryomov
2014-07-24 12:34   ` Alex Elder
2014-07-24  8:42 ` [PATCH 3/8] rbd: remove unnecessary asserts in rbd_dev_image_probe() Ilya Dryomov
2014-07-24 12:40   ` Alex Elder
2014-07-24  8:42 ` [PATCH 4/8] rbd: split rbd_dev_spec_update() into two functions Ilya Dryomov
2014-07-24 12:55   ` Alex Elder
2014-07-24  8:42 ` [PATCH 5/8] rbd: harden rbd_dev_refresh() caller Ilya Dryomov
2014-07-24 13:09   ` Alex Elder
2014-07-24  8:42 ` [PATCH 6/8] rbd: update mapping size only on refresh Ilya Dryomov
2014-07-24 13:25   ` Alex Elder
2014-07-24 13:46     ` Ilya Dryomov
2014-07-24 15:10       ` Ilya Dryomov
2014-07-25 13:31         ` Alex Elder [this message]
2014-07-24 17:59       ` Alex Elder
2014-07-24  8:42 ` [PATCH 7/8] rbd: do not read in parent info before snap context Ilya Dryomov
2014-07-25  8:14   ` Alex Elder
2014-07-25  8:36     ` Ilya Dryomov
2014-07-25 12:46       ` Alex Elder
2014-07-24  8:42 ` [PATCH 8/8] rbd: take snap_id into account when reading in parent info Ilya Dryomov
2014-07-24 18:43   ` Alex Elder

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=53D25C42.4080807@ieee.org \
    --to=elder@ieee.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=ilya.dryomov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox