Commit:     ba8b45cea5f632540d561d37d94c71c07f6af1aa
Parent:     b997b82d266c9fb910fc2ad95b9bb93b3bccf9be
Author:     Jonathan Brassow <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 02:33:08 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed May 9 12:30:48 2007 -0700

    dm log: fix resume failed log device
    This patch removes the possibility of having uninitialized log state if the
    log device has failed.
    When a mirror resumes operation, it calls 'resume' on the logging module.  
    disk based logging is being used, the log device is read to fill in the log
    state.  If the log device has failed, we cannot simply return, because this
    would leave the in-memory log state uninitialized.  Instead, we assume all
    regions are out-of-sync and reset the log state.  Failure to do this could
    result in the logging code reporting a region as in-sync, even though it
    isn't; which could result in a corrupted mirror.
    Signed-off-by: Jonathan Brassow <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/md/dm-log.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index a60acf8..a66428d 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -478,7 +478,14 @@ static int disk_resume(struct dirty_log *log)
                DMWARN("%s: Failed to read header on mirror log device",
-               return r;
+               /*
+                * If the log device cannot be read, we must assume
+                * all regions are out-of-sync.  If we simply return
+                * here, the state will be uninitialized and could
+                * lead us to return 'in-sync' status for regions
+                * that are actually 'out-of-sync'.
+                */
+               lc->header.nr_regions = 0;
        /* set or clear any new bits -- device has grown */
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

Reply via email to