From: Takahiro Yasui <tyasui@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [PATCH] Don't lose writes if errors are not handled and log fails
Date: Mon, 01 Feb 2010 12:26:14 -0500 [thread overview]
Message-ID: <4B670EB6.5000201@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1001311530280.13480@hs20-bc2-1.build.redhat.com>
> 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
> dm-raid1.
>
> It doesn't need to be backported to RHEL 5.5, because lvm always passes a
> flag to handle errors there.
Don't we need to backport it to RHEL 5.5? If lvm is the only user of dm-raid1,
we don't need to backport it to RHEL 5.5. But if not, we need to.
> 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:
> do_writes:
> bio_list_merge(&ms->failures, &sync);
> do_failures:
> 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
> do_writes.
>
> 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
> do_failures.
I agree that bios should be issued by do_write() when ms->log_failures is set,
but do we need to add bios to the failures queue? As you mentioned, the failures
queue should be used to bios which are already handled. Therefore, I think
bios are better to handled directly by hold_bio() instead of adding them to
the failures queue as bios for nosync regions are done.
- 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) && errors_handled(ms))
+ hold_bio(ms, bio);
+ else
do_write(ms, bio);
The policy to treat bios when ms->log_failures == 1 is different, but
the above code is based on the following patch.
https://www.redhat.com/archives/dm-devel/2009-December/msg00211.html
Thanks,
Taka
next prev parent reply other threads:[~2010-02-01 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-31 20:34 [PATCH] Don't lose writes if errors are not handled and log fails Mikulas Patocka
2010-02-01 17:26 ` Takahiro Yasui [this message]
2010-02-02 13:00 ` Mikulas Patocka
2010-02-02 18:17 ` [PATCH] If all legs fail, return an error Mikulas Patocka
2010-02-02 19:47 ` Takahiro Yasui
2010-02-02 19:46 ` [PATCH] Don't lose writes if errors are not handled and log fails Takahiro Yasui
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=4B670EB6.5000201@redhat.com \
--to=tyasui@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@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 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.