mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Fix incorrect handling of jiffies wrap around as pointed out by Bart Van Assche.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3901 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -795,11 +795,7 @@ int scst_suspend_activity(unsigned long timeout)
|
||||
scst_get_cmd_counter());
|
||||
|
||||
if (timeout != SCST_SUSPEND_TIMEOUT_UNLIMITED) {
|
||||
unsigned long cur_time1 = jiffies;
|
||||
if (cur_time1 >= cur_time)
|
||||
wait_time = cur_time1 - cur_time;
|
||||
else
|
||||
wait_time = cur_time - cur_time1;
|
||||
wait_time = jiffies - cur_time;
|
||||
/* just in case */
|
||||
if (wait_time >= timeout) {
|
||||
res = -EBUSY;
|
||||
|
||||
Reference in New Issue
Block a user