Re: A lockd bug in linux 2.1.127

Linus Torvalds (torvalds@transmeta.com)
Sun, 8 Nov 1998 14:04:35 -0800 (PST)


On Sun, 8 Nov 1998, H.J. Lu wrote:
>
> schedule_timeout: wrong timeout value xxxxx from xxxxx
>
> It looks like timeout here can be negative in lockd. Is there a typo?

No, the problem is that "nlmsvc_retry_blocked()" sometimes returns 0, and
sometimes returns a jiffy. Making "nlmsvc_retry_blocked()" always return a
timeout should fix the problem. Does something like this fix it for you?

Linus

-----
diff -u --recursive v2.1.127/linux/fs/lockd/svc.c linux/fs/lockd/svc.c
--- v2.1.127/linux/fs/lockd/svc.c Sun Nov 8 14:03:06 1998
+++ linux/fs/lockd/svc.c Sun Nov 8 13:58:53 1998
@@ -135,7 +135,7 @@
* during grace period).
*/
if (!nlmsvc_grace_period) {
- timeout = nlmsvc_retry_blocked() - jiffies;
+ timeout = nlmsvc_retry_blocked();
} else if (nlmsvc_grace_period < jiffies)
nlmsvc_grace_period = 0;

diff -u --recursive v2.1.127/linux/fs/lockd/svclock.c linux/fs/lockd/svclock.c
--- v2.1.127/linux/fs/lockd/svclock.c Wed Aug 26 11:37:41 1998
+++ linux/fs/lockd/svclock.c Sun Nov 8 14:02:19 1998
@@ -615,6 +615,7 @@
}

if ((block = nlm_blocked) && block->b_when != NLM_NEVER)
- return block->b_when;
- return 0;
+ return (block->b_when - jiffies);
+
+ return MAX_SCHEDULE_TIMEOUT;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/