From: thornber@redhat.com
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: dm-thin discard issue
Date: Wed, 6 Mar 2013 16:06:53 +0000 [thread overview]
Message-ID: <20130306160653.GC4852@raspberrypi> (raw)
In-Reply-To: <20130306142621.GA4852@raspberrypi>
Hi Jim,
On Wed, Mar 06, 2013 at 02:26:22PM +0000, thornber@redhat.com wrote:
> On Wed, Mar 06, 2013 at 08:12:39AM -0500, Jim Minter wrote:
> > Hello,
> >
> > I think I've uncovered a problem when issuing the BLKDISCARD ioctl to a thin volume. If I create a thin volume, fill it with data, snapshot it, then call BLKDISCARD on the thin volume, it looks like the kernel doesn't take into account the fact that the underlying blocks are shared with the snapshot, and just goes ahead and discards them. This appears to then leave the metadata in an inconsistent state.
> >
> > Here's a reproducer (works on rawhide as of today, 3.9.0-0.rc1.git0.1.fc19.x86_64):
> > (assumes volumes 253:2 for metadata and 253:3 for pool; uses blkdiscard from upstream util-linux to issue the BLKDISCARD ioctl)
>
> Alarming, to say the least. Give me a couple of hours to look at this ...
I managed to reproduce with this test:
def test_discard_origin_does_not_effect_snap
with_standard_pool(@size) do |pool|
with_new_thin(pool, @volume_size, 0) do |thin|
wipe_device(thin)
assert_used_blocks(pool, @blocks_per_dev)
with_new_snap(pool, @volume_size, 1, 0, thin) do |snap|
assert_used_blocks(pool, @blocks_per_dev)
end
thin.discard(0, @volume_size)
assert_used_blocks(pool, @blocks_per_dev)
end
assert_used_blocks(pool, @blocks_per_dev)
end
end
This commit fixes the issue:
https://github.com/jthornber/linux-2.6/commit/a42dfef751cb666d3274346c07dff655cb40cc5a
I'm really sorry about this, we should have covered this better in the
tests.
- Joe
prev parent reply other threads:[~2013-03-06 16:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1801783.47.1362573815861.JavaMail.javamailuser@localhost>
2013-03-06 13:12 ` dm-thin discard issue Jim Minter
2013-03-06 14:26 ` thornber
2013-03-06 16:06 ` thornber [this message]
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=20130306160653.GC4852@raspberrypi \
--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.