diff options
author | NeilBrown <neilb@suse.de> | 2009-06-30 23:15:35 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-30 23:15:35 -0400 |
commit | e62e58a5ffdc98ac28d8dbd070c857620d541f99 (patch) | |
tree | 0ec3471f4e66e3a376ac8cb2da79d6123e7aa2cf /drivers/md/md.c | |
parent | a5c308d4d1659b1f4833b863394e3e24cdbdfc6e (diff) |
md: use interruptible wait when duration is controlled by userspace.
User space can set various limits on an md array so that resync waits
when it gets to a certain point, or so that I/O is blocked for a short
while.
When md is waiting against one of these limit, it should use an
interruptible wait so as not to add to the load average, and so are
not to trigger a warning if the wait goes on for too long.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 65fe35b5e34a..0f4a70c43ffc 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6336,10 +6336,16 @@ void md_do_sync(mddev_t *mddev) | |||
6336 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); | 6336 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); |
6337 | } | 6337 | } |
6338 | 6338 | ||
6339 | if (j >= mddev->resync_max) | 6339 | while (j >= mddev->resync_max && !kthread_should_stop()) { |
6340 | wait_event(mddev->recovery_wait, | 6340 | /* As this condition is controlled by user-space, |
6341 | mddev->resync_max > j | 6341 | * we can block indefinitely, so use '_interruptible' |
6342 | || kthread_should_stop()); | 6342 | * to avoid triggering warnings. |
6343 | */ | ||
6344 | flush_signals(current); /* just in case */ | ||
6345 | wait_event_interruptible(mddev->recovery_wait, | ||
6346 | mddev->resync_max > j | ||
6347 | || kthread_should_stop()); | ||
6348 | } | ||
6343 | 6349 | ||
6344 | if (kthread_should_stop()) | 6350 | if (kthread_should_stop()) |
6345 | goto interrupted; | 6351 | goto interrupted; |