From: Mike Snitzer <snitzer@redhat.com>
To: Nikos Tsironis <ntsironis@arrikto.com>
Cc: dm-devel@redhat.com, Mikulas Patocka <mpatocka@redhat.com>,
ejt@redhat.com, agk@redhat.com
Subject: Re: [PATCH v2] dm thin: Fix bug wrt FUA request completion
Date: Thu, 14 Feb 2019 19:10:55 -0500 [thread overview]
Message-ID: <20190215001054.GA17160@redhat.com> (raw)
In-Reply-To: <20190214232138.25667-1-ntsironis@arrikto.com>
On Thu, Feb 14 2019 at 6:21pm -0500,
Nikos Tsironis <ntsironis@arrikto.com> wrote:
> When provisioning a new data block for a virtual block, either because
> the block was previously unallocated or because we are breaking sharing,
> if the whole block of data is being overwritten the bio that triggered
> the provisioning is issued immediately, skipping copying or zeroing of
> the data block.
>
> When this bio completes the new mapping is inserted in to the pool's
> metadata by process_prepared_mapping(), where the bio completion is
> signaled to the upper layers.
>
> This completion is signaled without first committing the metadata. If
> the bio in question has the REQ_FUA flag set and the system crashes
> right after its completion and before the next metadata commit, then the
> write is lost despite the REQ_FUA flag requiring that I/O completion for
> this request is only signaled after the data has been committed to
> non-volatile storage.
>
> Fix this by deferring the completion of overwrite bios, with the REQ_FUA
> flag set, after the metadata has been committed.
>
> Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
> ---
> drivers/md/dm-thin.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 50 insertions(+), 5 deletions(-)
>
> Changes in v2:
> - Add missing bio_list_init() in pool_create()
>
> v1: https://www.redhat.com/archives/dm-devel/2019-February/msg00064.html
Thanks a lot for your fix. Amazing this was missed until now.
I staged your fix in linux-next and will be sending it to Linus
tomorrow (you'll note I tweaked the subject and header very slightly):
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.0&id=4ae280b4ee3463fa57bbe6eede26b97daff8a0f1
Thanks again,
Mike
next prev parent reply other threads:[~2019-02-15 0:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 23:21 [PATCH v2] dm thin: Fix bug wrt FUA request completion Nikos Tsironis
2019-02-15 0:10 ` Mike Snitzer [this message]
2019-02-15 13:54 ` Joe Thornber
2019-02-15 14:33 ` Nikos Tsironis
2019-02-15 15:16 ` Mike Snitzer
2019-02-15 17:21 ` Nikos Tsironis
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=20190215001054.GA17160@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ejt@redhat.com \
--cc=mpatocka@redhat.com \
--cc=ntsironis@arrikto.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.