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:
Vladislav Bolkhovitin
2011-10-26 19:32:58 +00:00
parent 05caa249b5
commit 6fccbdfd9a

View File

@@ -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;