Re: New kernel - netscape hangs

Mark Lord (mlord@pobox.com)
Tue, 09 Feb 1999 19:27:16 -0500


HJ: the patch below works well here.

Oddly enough, I *needed* to apply this patch to connect to
the Linus Torvalds chat session today at:

http://www.msnbc.com/news/239469.asp

Is this still the latest version?

Thanks!
mlord@pobox.com

"H.J. Lu" wrote:
...
> How about this patch instead? F_SETLKW will wait forever and F_SETLK
> will return an error?
>
> H.J.
>
>
> Index: fs/lockd/clntproc.c
> ===================================================================
> RCS file: /local/work/cvs/linux/linux/fs/lockd/clntproc.c,v
> retrieving revision 1.1.1.8
> diff -u -p -r1.1.1.8 clntproc.c
> --- clntproc.c 1999/01/27 00:29:00 1.1.1.8
> +++ clntproc.c 1999/02/05 17:55:55
> @@ -230,9 +230,24 @@ nlmclnt_call(struct nlm_rqst *req, u32 p
> /* Perform the RPC call. If an error occurs, try again */
> if ((status = rpc_call(clnt, proc, argp, resp, 0)) < 0) {
> dprintk("lockd: rpc_call returned error %d\n", -status);
> - if (status == -ERESTARTSYS)
> - return status;
> - nlm_rebind_host(host);
> + switch (status) {
> + case -EPROTONOSUPPORT:
> + status = -EINVAL;
> + break;
> + case -ECONNREFUSED:
> + case -ETIMEDOUT:
> + case -ENOTCONN:
> + status = -EAGAIN;
> + break;
> + case -ERESTARTSYS:
> + return signalled () ? -EINTR : status;
> + default:
> + break;
> + }
> + if (req->a_args.block)
> + nlm_rebind_host(host);
> + else
> + break;
> } else
> if (resp->status == NLM_LCK_DENIED_GRACE_PERIOD) {
> dprintk("lockd: server in grace period\n");
> @@ -248,9 +263,18 @@ nlmclnt_call(struct nlm_rqst *req, u32 p
>
> /* Back off a little and try again */
> interruptible_sleep_on_timeout(&host->h_gracewait, 15*HZ);
> - } while (!signalled());
> +
> + /* When the lock requested by F_SETLKW isn't available,
> + we will wait until the request can be satisfied. If
> + a signal is received during wait, we should return
> + -EINTR. */
> + if (signalled ()) {
> + status = -EINTR;
> + break;
> + }
> + } while (1);
>
> - return -ERESTARTSYS;
> + return status;
> }
>
> /*
> Index: net/sunrpc/pmap_clnt.c
> ===================================================================
> RCS file: /local/work/cvs/linux/linux/net/sunrpc/pmap_clnt.c,v
> retrieving revision 1.1.1.3
> diff -u -p -r1.1.1.3 pmap_clnt.c
> --- pmap_clnt.c 1997/10/25 04:26:38 1.1.1.3
> +++ pmap_clnt.c 1999/01/27 23:36:35
> @@ -121,7 +121,7 @@ pmap_getport_done(struct rpc_task *task)
> task->tk_action = NULL;
> } else if (clnt->cl_port == 0) {
> /* Program not registered */
> - task->tk_status = -EACCES;
> + task->tk_status = -EPROTONOSUPPORT;
> task->tk_action = NULL;
> } else {
> /* byte-swap port number first */

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