*/
#include <linux/kthread.h>
+#include <linux/freezer.h>
#include <linux/blkdev.h>
#include <linux/sysctl.h>
#include <linux/seq_file.h>
*
*/
+ set_freezable();
+
do {
mddev->curr_resync = 2;
try_again:
- if (kthread_should_stop())
+
+ if (kthread_freezable_should_stop(NULL))
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
* time 'round when curr_resync == 2
*/
continue;
+
+ try_to_freeze();
+
/* We need to wait 'interruptible' so as not to
* contribute to the load average, and not to
* be caught by 'softlockup'
" share one or more physical units)\n",
desc, mdname(mddev), mdname(mddev2));
mddev_put(mddev2);
+ try_to_freeze();
if (signal_pending(current))
flush_signals(current);
schedule();
|| kthread_should_stop());
}
- if (kthread_should_stop())
+ if (kthread_freezable_should_stop(NULL))
goto interrupted;
sectors = mddev->pers->sync_request(mddev, j, &skipped,
last_mark = next;
}
-
- if (kthread_should_stop())
+ if (kthread_freezable_should_stop(NULL))
goto interrupted;
*/
void md_check_recovery(struct mddev *mddev)
{
- if (mddev->suspended)
+#ifdef CONFIG_FREEZER
+ if (mddev->suspended || unlikely(atomic_read(&system_freezing_cnt)))
return;
+#endif
if (mddev->bitmap)
bitmap_daemon_work(mddev);