Re: 2.1.127 knfs locking: "schedule_timeout: wrong timeout value fffac200"

Matthias Welwarsky (matze@stud.fbi.fh-darmstadt.de)
Thu, 12 Nov 1998 00:32:04 +0100


David Woodhouse wrote:
>
> I took the opportunity of a quiet weekend to upgrade our server to use knfsd.
> Unfortunately, I found that the timeout changes in 2.1.127 cause the machine to
> lock up whenever I try to use file locking, which was the only reason I wanted
> to upgrade anyway.
>
> For some reason, the lockd code calls svc_recv with a timeout value less than
> zero. The new schedule_timeout() just whinges and returns immediately, and the
> lockd code loops for ever.
>
> The attached patch fixes both lockd and schedule_timeout(). The former now
> checks for a timeout value of less than zero, and the latter will schedule()
> anyway.
>

Hi Dave,

looking at the patch it seems this is _not_ the right way to fix the
problem. The reason why sometimes *_timeout() is called with negative
value is because a process wants to sleep "forever". Before 2.1.127 the
following code was quite reasonable:

current->timeout = -1;
current->state = TASK_INTERRUPTIBLE;
schedule();

while now

schedule_timeout(-1);

is obviously wrong. The correct way to wait "forever" is

schedule_timeout(MAX_SCHEDULE_TIMEOUT);

Better not break schedule_timeout() to hide other broken code...

Gruss,
Matthias

-
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/