From: Takahiro Yasui <tyasui@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH][BUGFIX] dm-raid1: fix data lost on success return at log failure
Date: Wed, 23 Dec 2009 17:18:41 -0500 [thread overview]
Message-ID: <4B329741.9050704@redhat.com> (raw)
This patch fix the case that I/Os return "success" (0) even though
they have never been attempted on the devices. When the log has
failed and the DM_RAID_HANDLE_ERRORS flag is not set, I/Os are put
in the failures queue and return "success" (0) in the do_failures()
function. This is really *data lost*. When the log has failed, all
I/Os should be held in kernel as 2.6.32 kernel does.
Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
drivers/md/dm-raid1.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
Index: linux-2.6.33-rc1-dm/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-raid1.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-raid1.c
@@ -724,13 +724,10 @@ static void do_writes(struct mirror_set
/*
* Dispatch io.
*/
- if (unlikely(ms->log_failure)) {
- spin_lock_irq(&ms->lock);
- bio_list_merge(&ms->failures, &sync);
- spin_unlock_irq(&ms->lock);
- wakeup_mirrord(ms);
- } else
- while ((bio = bio_list_pop(&sync)))
+ while ((bio = bio_list_pop(&sync)))
+ if (unlikely(ms->log_failure))
+ hold_bio(ms, bio);
+ else
do_write(ms, bio);
while ((bio = bio_list_pop(&recover)))
--
Takahiro Yasui
Hitachi Computer Products (America), Inc.
reply other threads:[~2009-12-23 22:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4B329741.9050704@redhat.com \
--to=tyasui@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox