The timeout in ll_kill_super() is intended to be
1/8 of a second, while it loops waiting on other
threads to finish. However, this was incorrectly
calculated to always be 0 (infinite wait) due to
integer division.
Instead, convert seconds to jiffies before division.
Fixes:
0c2cc920370e ("LU-9019 libcfs: avoid using HZ and msecs_to_jiffies()")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I33efbfc2d6c0a9c4ae6404c1974c7593a72540e5
Reviewed-on: https://review.whamcloud.com/35992
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
/* wait running statahead threads to quit */
while (atomic_read(&sbi->ll_sa_running) > 0) {
set_current_state(TASK_UNINTERRUPTIBLE);
/* wait running statahead threads to quit */
while (atomic_read(&sbi->ll_sa_running) > 0) {
set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(cfs_time_seconds(1 >> 3));
+ schedule_timeout(cfs_time_seconds(1) >> 3);
/* Always wait a few seconds to allow the server who
caused the lock revocation to finish its setup, plus some
random so everyone doesn't try to reconnect at once. */
/* Always wait a few seconds to allow the server who
caused the lock revocation to finish its setup, plus some
random so everyone doesn't try to reconnect at once. */
- to = cfs_time_seconds(MGC_TIMEOUT_MIN_SECONDS);
+ to = cfs_time_seconds(MGC_TIMEOUT_MIN_SECONDS * 100 + rand);
/* rand is centi-seconds */
/* rand is centi-seconds */
- to += cfs_time_seconds(rand) / 100;
- lwi = LWI_TIMEOUT(to, NULL, NULL);
+ lwi = LWI_TIMEOUT(to / 100, NULL, NULL);
l_wait_event(rq_waitq, rq_state & (RQ_STOP | RQ_PRECLEANUP),
&lwi);
l_wait_event(rq_waitq, rq_state & (RQ_STOP | RQ_PRECLEANUP),
&lwi);