diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-06-06 01:45:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-06 14:29:08 -0400 |
commit | a6d8113a986c66aeb379a26b6e0062488b3e59e1 (patch) | |
tree | b66aea459f4f3dcb9b13b8852f3e2b12b385ce94 /drivers/md/md.c | |
parent | e0a115e5aa554b93150a8dc1c3fe15467708abb2 (diff) |
md: fix uninitialized use of mddev->recovery_wait
If an array was created with --assume-clean we will oops when trying to
set ->resync_max.
Fix this by initializing ->recovery_wait in mddev_find.
Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 51c19f86ff99..7cf512a34ccf 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -276,6 +276,7 @@ static mddev_t * mddev_find(dev_t unit) | |||
276 | atomic_set(&new->active, 1); | 276 | atomic_set(&new->active, 1); |
277 | spin_lock_init(&new->write_lock); | 277 | spin_lock_init(&new->write_lock); |
278 | init_waitqueue_head(&new->sb_wait); | 278 | init_waitqueue_head(&new->sb_wait); |
279 | init_waitqueue_head(&new->recovery_wait); | ||
279 | new->reshape_position = MaxSector; | 280 | new->reshape_position = MaxSector; |
280 | new->resync_max = MaxSector; | 281 | new->resync_max = MaxSector; |
281 | new->level = LEVEL_NONE; | 282 | new->level = LEVEL_NONE; |
@@ -5665,7 +5666,6 @@ void md_do_sync(mddev_t *mddev) | |||
5665 | window/2,(unsigned long long) max_sectors/2); | 5666 | window/2,(unsigned long long) max_sectors/2); |
5666 | 5667 | ||
5667 | atomic_set(&mddev->recovery_active, 0); | 5668 | atomic_set(&mddev->recovery_active, 0); |
5668 | init_waitqueue_head(&mddev->recovery_wait); | ||
5669 | last_check = 0; | 5669 | last_check = 0; |
5670 | 5670 | ||
5671 | if (j>2) { | 5671 | if (j>2) { |