From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, "Alasdair G. Kergon" <agk@redhat.com>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: dm-mirror: fix crash with mirror recovery and discard
Date: Mon, 9 Jul 2012 08:16:38 -0400 [thread overview]
Message-ID: <20120709121638.GB30048@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1207061629150.16361@file.rdu.redhat.com>
On Fri, Jul 06 2012 at 4:38pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> > > + ti->discard_zeroes_data_unsupported = 1;
> > >
> > > ms->kmirrord_wq = alloc_workqueue("kmirrord",
> > > WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
> >
> > This should be split out to a separate patch and properly justified in
> > the patch header. Is there something unique to dm-mirror that renders
> > the underlying device's zeroing unreliable?
>
> There are two possible approaches to handling REQ_DISCARD
>
> 1. treat REQ_DISCARD as REQ_FLUSH (this is what the patch does) --- i.e.
> do not synchronize it with region states, do not set mirror error on
> failure. In this mode we must assume that there are uninitialized data
> after a flush.
>
> For example, if there is a region that is being resynchronized and we send
> REQ_DISCARD that overlaps this region, there is no guarantee that data in
> this region were zeroed.
>
> - kcopyd reads a few blocks for resynchronization
> - REQ_DISCARD is sent to both mirror legs, both disks overwrites the area
> with zeroes
> - kcopyd writes those blocks to the other leg => the blocks are no longer
> zero despite REQ_DISCARD being sent
OK, thanks, but my point still stands: this is worthy of a separate
patch (with the same type of backround you provided above).
> 2. treat REQ_DISCARD as writes (i.e. synchronize it with region states,
> wait until resynchronization finishes, etc.) --- it is possible to do it
> this way to, but if we do it this way, we have to split REQ_DISCARD on
> region boundaries (it is currently split only on target boundaries,
> which is insufficient).
I think discards should be treated as writes.
next prev parent reply other threads:[~2012-07-09 12:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 18:56 [PATCH] dm-mirror: fix crash with mirror recovery and discard Mikulas Patocka
2012-07-06 19:33 ` Brassow Jonathan
2012-07-06 19:49 ` Mike Snitzer
2012-07-06 20:38 ` Mikulas Patocka
2012-07-06 20:44 ` Mikulas Patocka
2012-07-09 12:16 ` Mike Snitzer [this message]
2012-07-09 23:12 ` Mikulas Patocka
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=20120709121638.GB30048@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@redhat.com \
--cc=zkabelac@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.