This is a note to let you know that I've just added the patch titled
md: fix clearing of the 'changed' flags for the bad blocks list.
to the 3.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
md-fix-clearing-of-the-changed-flags-for-the-bad-blocks-list.patch
and it can be found in the queue-3.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From d0962936bff659d20522555b517582a2715fd23f Mon Sep 17 00:00:00 2001
From: NeilBrown <[email protected]>
Date: Mon, 19 Mar 2012 12:46:41 +1100
Subject: md: fix clearing of the 'changed' flags for the bad blocks list.
From: NeilBrown <[email protected]>
commit d0962936bff659d20522555b517582a2715fd23f upstream.
In super_1_sync (the first hunk) we need to clear 'changed' before
checking read_seqretry(), otherwise we might race with other code
adding a bad block and so won't retry later.
In md_update_sb (the second hunk), in the case where there is no
metadata (neither persistent nor external), we treat any bad blocks as
an error. However we need to clear the 'changed' flag before calling
md_ack_all_badblocks, else it won't do anything.
This patch is suitable for -stable release 3.0 and later.
Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/md/md.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1801,13 +1801,13 @@ retry:
| BB_LEN(internal_bb));
*bbp++ = cpu_to_le64(store_bb);
}
+ bb->changed = 0;
if (read_seqretry(&bb->lock, seq))
goto retry;
bb->sector = (rdev->sb_start +
(int)le32_to_cpu(sb->bblog_offset));
bb->size = le16_to_cpu(sb->bblog_size);
- bb->changed = 0;
}
}
@@ -2362,6 +2362,7 @@ repeat:
clear_bit(MD_CHANGE_PENDING, &mddev->flags);
list_for_each_entry(rdev, &mddev->disks, same_set) {
if (rdev->badblocks.changed) {
+ rdev->badblocks.changed = 0;
md_ack_all_badblocks(&rdev->badblocks);
md_error(mddev, rdev);
}
Patches currently in stable-queue which might be from [email protected] are
queue-3.2/md-raid1-raid10-avoid-deadlock-during-resync-recovery.patch
queue-3.2/md-bitmap-ensure-to-load-bitmap-when-creating-via-sysfs.patch
queue-3.2/md-fix-clearing-of-the-changed-flags-for-the-bad-blocks-list.patch
queue-3.2/md-don-t-set-md-arrays-to-readonly-on-shutdown.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html