* [PATCH for v4.3-rc] dm: fix request-based dm error reporting
@ 2015-10-06 4:19 Junichi Nomura
2015-10-06 14:13 ` Mike Snitzer
0 siblings, 1 reply; 2+ messages in thread
From: Junichi Nomura @ 2015-10-06 4:19 UTC (permalink / raw)
To: device-mapper development; +Cc: Christoph Hellwig
end_clone_bio() is a endio callback for clone bio and should check
and save the clone's bi_error for error reporting. However,
4246a0b63bd8 ("block: add a bi_error field to struct bio") changed
the function to check the original bio's bi_error, which is 0.
Without this fix, clone's error is ignored and reported to the
original request as success. Thus data corruption will be observed.
Fixes: 4246a0b63bd8 ("block: add a bi_error field to struct bio")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 7289ece..dd6e667 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1001,7 +1001,9 @@ static void end_clone_bio(struct bio *clone)
struct dm_rq_target_io *tio = info->tio;
struct bio *bio = info->orig;
unsigned int nr_bytes = info->orig->bi_iter.bi_size;
+ int error;
+ error = clone->bi_error;
bio_put(clone);
if (tio->error)
@@ -1011,13 +1013,13 @@ static void end_clone_bio(struct bio *clone)
* the remainder.
*/
return;
- else if (bio->bi_error) {
+ else if (error) {
/*
* Don't notice the error to the upper layer yet.
* The error handling decision is made by the target driver,
* when the request is completed.
*/
- tio->error = bio->bi_error;
+ tio->error = error;
return;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH for v4.3-rc] dm: fix request-based dm error reporting
2015-10-06 4:19 [PATCH for v4.3-rc] dm: fix request-based dm error reporting Junichi Nomura
@ 2015-10-06 14:13 ` Mike Snitzer
0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2015-10-06 14:13 UTC (permalink / raw)
To: Junichi Nomura; +Cc: device-mapper development, Christoph Hellwig
On Tue, Oct 06 2015 at 12:19am -0400,
Junichi Nomura <j-nomura@ce.jp.nec.com> wrote:
> end_clone_bio() is a endio callback for clone bio and should check
> and save the clone's bi_error for error reporting. However,
> 4246a0b63bd8 ("block: add a bi_error field to struct bio") changed
> the function to check the original bio's bi_error, which is 0.
>
> Without this fix, clone's error is ignored and reported to the
> original request as success. Thus data corruption will be observed.
>
> Fixes: 4246a0b63bd8 ("block: add a bi_error field to struct bio")
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> Cc: Christoph Hellwig <hch@lst.de>
Thanks, I've applied it here:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=50887bd139b83ce4489ed865a04bf1be5559c4ad
I'll send it to Linus by the end of the week for 4.3-rc5 inclusion.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-06 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 4:19 [PATCH for v4.3-rc] dm: fix request-based dm error reporting Junichi Nomura
2015-10-06 14:13 ` Mike Snitzer
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.