* [PATCH][BUGFIX] dm-raid1: fix data lost on success return at log failure
@ 2009-12-23 22:18 Takahiro Yasui
0 siblings, 0 replies; only message in thread
From: Takahiro Yasui @ 2009-12-23 22:18 UTC (permalink / raw)
To: device-mapper development
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-12-23 22:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 22:18 [PATCH][BUGFIX] dm-raid1: fix data lost on success return at log failure Takahiro Yasui
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.