FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

LinkBack Thread Tools
Old 01-31-2010, 07:34 PM
Mikulas Patocka
Default Don't lose writes if errors are not handled and log fails


This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=555197

Please submit this patch before 2.6.33 goes out. It fixes a bug when old
LVM (<= 2.02.51) is used, that doesn't pass errors_handled flag to

It doesn't need to be backported to RHEL 5.5, because lvm always passes a
flag to handle errors there.


Don't lose writes if errors are not handled and log fails

If the log fails and errors are not handled by dmeventd, the writes
are successfully finished without being actually written to the device.

This code path is taken:
bio_list_merge(&ms->failures, &sync);
if (!get_valid_mirror(ms)) (false)
else if (errors_handled(ms)) (false)
else bio_endio(bio, 0);

The logic in do_failures is based on presuming that the write was already
tried --- if it succeeded at least on one leg and errors are not handled,
it is reported as success.

However, bio can be added to the failures queue without being submitted, in

This patch changes it so that bios are added to the failures list only if
errors are handled --- then, they will be held with hold_bio() called from

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

drivers/md/dm-raid1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.33-rc5-devel/drivers/md/dm-raid1.c
================================================== =================
--- linux-2.6.33-rc5-devel.orig/drivers/md/dm-raid1.c 2010-01-29 20:29:37.000000000 +0100
+++ linux-2.6.33-rc5-devel/drivers/md/dm-raid1.c 2010-01-30 00:04:18.000000000 +0100
@@ -724,7 +724,7 @@ static void do_writes(struct mirror_set
* Dispatch io.
- if (unlikely(ms->log_failure)) {
+ if (unlikely(ms->log_failure) && errors_handled(ms)) {
bio_list_merge(&ms->failures, &sync);

dm-devel mailing list

Thread Tools

All times are GMT. The time now is 04:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org