All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: dm-cache invalidate_cblocks range parsing
Date: Mon, 25 Nov 2013 10:00:02 +0000	[thread overview]
Message-ID: <20131125100002.GB10831@debian> (raw)
In-Reply-To: <20131125095018.GA10831@debian>

On Mon, Nov 25, 2013 at 09:50:19AM +0000, Joe Thornber wrote:
> On Sun, Nov 24, 2013 at 02:25:33AM +0000, Mears, Morgan wrote:
> > If one specifies a cblock range in the dm-cache invalidate_cblocks message
> > (commit 65790ff919e2e07ccb4457415c11075b245d643b), the final cblock in the 
> > range does not get invalidated.  For example, after:
> > 
> > 	dmsetup message cache 0 invalidate_cblocks 10-11
> > 
> > cblock 11 will still be in the cache.  The reason is the (begin != end)
> > check in process_invalidation_request() (dm-cache-target.c); were it to
> > change to (begin <= end), the final block would be treated like the rest.
> > 
> > However, parse_cblock_range() relies on the current behavior for the single
> > block case; if the change above were applied, an extra block would be
> > invalidated for each single-block invalidation request.
> > 
> > So: is the current behavior intentional?
> 
> Yes.

Documented in code, but I think Documentation/device-mapper/cache.txt should also say this.

/*                                                                                                                               
 * Defines a range of cblocks, begin to (end - 1) are in the range.  end is                                                      
 * the one-past-the-end value.                                                                                                   
 */

See 

https://github.com/jthornber/device-mapper-test-suite/blob/master/lib/dmtest/tests/cache/invalidate_cblocks_tests.rb

for example uses.

  reply	other threads:[~2013-11-25 10:00 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 [this message]
2013-11-25 22:46 ` Alasdair G Kergon
2013-11-26 16:20   ` Mike Snitzer
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=20131125100002.GB10831@debian \
    --to=thornber@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.