Seen in RH 2.6.32, please consider for longterm inclusion.
Applies fine to latest Debian 2.6.32.

thank you.

----- Forwarded message from Linux Kernel Mailing List 
<[email protected]> -----

Date: Tue, 16 Feb 2010 20:59:17 GMT
From: Linux Kernel Mailing List <[email protected]>
To: [email protected]
Subject: dm raid1: fail writes if errors are not handled and log fails

Gitweb:     http://git.kernel.org/linus/5528d17de1cf1462f285c40ccaf8e0d0e4c64dc0
Commit:     5528d17de1cf1462f285c40ccaf8e0d0e4c64dc0
Parent:     ebfd32bba9b518d684009d9d21a56742337ca1b3
Author:     Mikulas Patocka <[email protected]>
AuthorDate: Tue Feb 16 18:42:55 2010 +0000
Committer:  Alasdair G Kergon <[email protected]>
CommitDate: Tue Feb 16 18:42:55 2010 +0000

    dm raid1: fail writes if errors are not handled and log fails
    
    If the mirror log fails when the handle_errors option was not selected
    and there is no remaining valid mirror leg, writes return success even
    though they weren't actually written to any device.  This patch
    completes them with EIO instead.
    
    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 (without handle_errors) it
    is reported as success.
    
    Reference: https://bugzilla.redhat.com/show_bug.cgi?id=555197
    
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Alasdair G Kergon <[email protected]>
---
 drivers/md/dm-raid1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index ad779bd..6c1046d 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -724,7 +724,7 @@ static void do_writes(struct mirror_set *ms, struct 
bio_list *writes)
        /*
         * Dispatch io.
         */
-       if (unlikely(ms->log_failure)) {
+       if (unlikely(ms->log_failure) && errors_handled(ms)) {
                spin_lock_irq(&ms->lock);
                bio_list_merge(&ms->failures, &sync);
                spin_unlock_irq(&ms->lock);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

----- End forwarded message -----

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to