Re: New kernel - netscape hangs

H.J. Lu (hjl@varesearch.com)
Fri, 05 Feb 1999 10:11:17 -0800


This is a multi-part message in MIME format.
--------------5CE7D553AEF46FD38A818CAE
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 7bit

Alan Cox wrote:

> > > Ok I'll run a test on that. But it should be using NFS timeouts IMHO, thats
> > > what BSD seems to do.
> >
> > Which BSD?
>
> SunOS 4.1.3 - if the lockd dies it waits, if the lockd is restored it comes back.
> (its all I had handy)
>
> Ok. I still think it should wait - the patch looks fine for the non waiting case
> and beats hanging forever

How about this patch instead? F_SETLKW will wait forever and F_SETLK
will return an error?

H.J.

--------------5CE7D553AEF46FD38A818CAE
Content-Type: text/plain; charset=gb2312;
name="lock"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="lock"

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

--------------5CE7D553AEF46FD38A818CAE--

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