提交 d8e64406 编写于 作者: D Dan Williams

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: NDan Williams <dan.j.williams@intel.com>
上级 23397883
...@@ -3483,7 +3483,7 @@ static void md_safemode_timeout(unsigned long data) ...@@ -3483,7 +3483,7 @@ static void md_safemode_timeout(unsigned long data)
if (!atomic_read(&mddev->writes_pending)) { if (!atomic_read(&mddev->writes_pending)) {
mddev->safemode = 1; mddev->safemode = 1;
if (mddev->external) if (mddev->external)
sysfs_notify(&mddev->kobj, NULL, "array_state"); set_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags);
} }
md_wakeup_thread(mddev->thread); md_wakeup_thread(mddev->thread);
} }
...@@ -6051,6 +6051,9 @@ void md_check_recovery(mddev_t *mddev) ...@@ -6051,6 +6051,9 @@ void md_check_recovery(mddev_t *mddev)
if (mddev->bitmap) if (mddev->bitmap)
bitmap_daemon_work(mddev->bitmap); bitmap_daemon_work(mddev->bitmap);
if (test_and_clear_bit(MD_NOTIFY_ARRAY_STATE, &mddev->flags))
sysfs_notify(&mddev->kobj, NULL, "array_state");
if (mddev->ro) if (mddev->ro)
return; return;
......
...@@ -128,6 +128,7 @@ struct mddev_s ...@@ -128,6 +128,7 @@ struct mddev_s
#define MD_CHANGE_DEVS 0 /* Some device status has changed */ #define MD_CHANGE_DEVS 0 /* Some device status has changed */
#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */
#define MD_CHANGE_PENDING 2 /* superblock update in progress */ #define MD_CHANGE_PENDING 2 /* superblock update in progress */
#define MD_NOTIFY_ARRAY_STATE 3 /* atomic context wants to notify userspace */
int ro; int ro;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册