All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: dm-cache invalidate_cblocks range parsing
Date: Tue, 26 Nov 2013 11:20:47 -0500	[thread overview]
Message-ID: <20131126162046.GA27431@redhat.com> (raw)
In-Reply-To: <20131125224618.GG27771@agk-dp.fab.redhat.com>

On Mon, Nov 25 2013 at  5:46pm -0500,
Alasdair G Kergon <agk@redhat.com> wrote:

> On Sun, Nov 24, 2013 at 02:25:33AM +0000, Mears, Morgan wrote:
> > 	dmsetup message cache 0 invalidate_cblocks 10-11
> > cblock 11 will still be in the cache.  
> 
> I think that should be changed.
> 
> It runs counter to the way LVM handles range specifications and seems
> set to create avoidable ambiguity: everyone looking at any ranges in
> dm/lvm would now have to check whether the last item in a range is
> included or not in each context they encounter one as we would no longer
> present a consistent position on this.
>
> To my mind, 10-11 expands to the list of integer block labels consisting 
> of 10 and 11,  (We are not talking about intervals pulled out of a
> continuous number line here: 10-10.9 would have no meaning.)  I consider
> blocks to be discrete objects and saying "the last numbered block listed
> is always excluded" strikes me as counter-intuitive.
> 
> The compromise we reached for dm statistics to reduce the chance of
> misinterpretation was to use start+number_of_items: so 10+1 in this case
> where only one block was meant to be included.

I'm embracing what Joe would like to use.  His preference for this
syntax isn't his alone, see:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt08ch19s02.html

As for targets having different meanings for ranges.  People already
need to pour over the table syntax of a given target if they'd like to
assemble it by hand.  Needing to understand the invalidate_cblocks
mesaage range is "one past the end" isn't asking too much.

The invalidate_cblocks interface is really intended to be used by the
cache tools, not humans.

I updated cache.txt to properly document the range syntax, see:
http://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=f0417b93a59e8f2

  reply	other threads:[~2013-11-26 16:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24  2:25 dm-cache invalidate_cblocks range parsing Mears, Morgan
2013-11-25  9:50 ` Joe Thornber
2013-11-25 10:00   ` Joe Thornber
2013-11-25 22:46 ` Alasdair G Kergon
2013-11-26 16:20   ` Mike Snitzer [this message]
2013-11-26 16:39     ` Alasdair G Kergon
2013-11-26 16:54     ` Alasdair G Kergon
2013-11-27 12:12   ` Joe Thornber

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=20131126162046.GA27431@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.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.