diff options
author | NeilBrown <neilb@suse.de> | 2011-01-13 17:13:53 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-13 17:13:53 -0500 |
commit | 6c9879101442b08581e8a0e3ae6b7f643a78fd63 (patch) | |
tree | bfe780d4e09896988fe367aa329a94daf55163c9 /drivers/md | |
parent | bf572541ab44240163eaa2d486b06f306a31d45a (diff) |
md: fix regression resulting in delays in clearing bits in a bitmap
commit 589a594be1fb (2.6.37-rc4) fixed a problem were md_thread would
sometimes call the ->run function at a bad time.
If an error is detected during array start up after the md_thread has
been started, the md_thread is killed. This resulted in the ->run
function being called once. However the array may not be in a state
that it is safe to call ->run.
However the fix imposed meant that ->run was not called on a timeout.
This means that when an array goes idle, bitmap bits do not get
cleared promptly. While the array is busy the bits will still be
cleared when appropriate so this is not very serious. There is no
risk to data.
Change the test so that we only avoid calling ->run when the thread
is being stopped. This more explicitly addresses the problem situation.
This is suitable for 2.6.37-stable and any -stable kernel to which
589a594be1fb was applied.
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 0da25daea9be..a3019121dc57 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6042,7 +6042,8 @@ static int md_thread(void * arg) | |||
6042 | || kthread_should_stop(), | 6042 | || kthread_should_stop(), |
6043 | thread->timeout); | 6043 | thread->timeout); |
6044 | 6044 | ||
6045 | if (test_and_clear_bit(THREAD_WAKEUP, &thread->flags)) | 6045 | clear_bit(THREAD_WAKEUP, &thread->flags); |
6046 | if (!kthread_should_stop()) | ||
6046 | thread->run(thread->mddev); | 6047 | thread->run(thread->mddev); |
6047 | } | 6048 | } |
6048 | 6049 | ||