diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-08-30 03:33:33 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-08-30 04:06:20 -0400 |
commit | bd52b746262c8d77e73903d6608014fb2fcdcd9d (patch) | |
tree | 5ee5789f1aae4b238d42c05672db90886b19280e /drivers/md/md.c | |
parent | 7c44ece988a3419e51c833cf14be186a22224dd1 (diff) |
md: don't clear MD_CHANGE_CLEAN in md_update_sb() for external arrays
If this bit is cleared in md_update_sb() the kernel will allow writes to the
array if userspace triggers md_allow_write(), e.g. through stripe_cache_size,
when mdmon is not active. When mdmon is active the array transitions to
active-idle bypassing write-pending, setting up a race for mdmon to set the
array clean before a write arrives.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index c148b6302154..a1f6b59b8b37 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2167,9 +2167,10 @@ repeat: | |||
2167 | rdev->recovery_offset = mddev->curr_resync_completed; | 2167 | rdev->recovery_offset = mddev->curr_resync_completed; |
2168 | 2168 | ||
2169 | } | 2169 | } |
2170 | if (mddev->external || !mddev->persistent) { | 2170 | if (!mddev->persistent) { |
2171 | if (!mddev->external) | ||
2172 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
2171 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); | 2173 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); |
2172 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
2173 | wake_up(&mddev->sb_wait); | 2174 | wake_up(&mddev->sb_wait); |
2174 | return; | 2175 | return; |
2175 | } | 2176 | } |