aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-07-23 16:09:48 -0400
committerDan Williams <dan.j.williams@intel.com>2008-07-23 16:09:48 -0400
commitd8e64406a037a64444175730294e449c9e21f5ec (patch)
tree5ac7525899ebc1d2fd9a83a6e19cd0b1b1b1711d
parent2339788376e2d69a9154130e4dacd5b21ce63094 (diff)
md: delay notification of 'active_idle' to the recovery thread
sysfs_notify might sleep, so do not call it from md_safemode_timeout. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/md/md.c5
-rw-r--r--include/linux/raid/md_k.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c2ff77ccec50..0f1b83096425 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3483,7 +3483,7 @@ static void md_safemode_timeout(unsigned long data)
3483 if (!atomic_read(&mddev->writes_pending)) { 3483 if (!atomic_read(&mddev->writes_pending)) {
3484 mddev->safemode = 1; 3484 mddev->safemode = 1;
3485 if (mddev->external) 3485 if (mddev->external)
3486 sysfs_notify(&mddev->kobj, NULL, "array_state"); 3486 set_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags);
3487 } 3487 }
3488 md_wakeup_thread(mddev->thread); 3488 md_wakeup_thread(mddev->thread);
3489} 3489}
@@ -6051,6 +6051,9 @@ void md_check_recovery(mddev_t *mddev)
6051 if (mddev->bitmap) 6051 if (mddev->bitmap)
6052 bitmap_daemon_work(mddev->bitmap); 6052 bitmap_daemon_work(mddev->bitmap);
6053 6053
6054 if (test_and_clear_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags))
6055 sysfs_notify(&mddev->kobj, NULL, "array_state");
6056
6054 if (mddev->ro) 6057 if (mddev->ro)
6055 return; 6058 return;
6056 6059
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 9f2549ac0e2d..c200b9a34aff 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -128,6 +128,7 @@ struct mddev_s
128#define MD_CHANGE_DEVS 0 /* Some device status has changed */ 128#define MD_CHANGE_DEVS 0 /* Some device status has changed */
129#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ 129#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */
130#define MD_CHANGE_PENDING 2 /* superblock update in progress */ 130#define MD_CHANGE_PENDING 2 /* superblock update in progress */
131#define MD_NOTIFY_ARRAY_STATE 3 /* atomic context wants to notify userspace */
131 132
132 int ro; 133 int ro;
133 134