*** linux-2.4.19/fs/lockd/svc.c Sun Oct 21 10:32:33 2001 --- linux-2.4.19.lockd_delay_patch/fs/lockd/svc.c Mon Oct 7 22:16:20 2002 *************** *** 144,151 **** */ if (!nlmsvc_grace_period) { timeout = nlmsvc_retry_blocked(); ! } else if (time_before(grace_period_expire, jiffies)) ! clear_grace_period(); /* * Find a socket with data available and call its --- 144,150 ---- */ if (!nlmsvc_grace_period) { timeout = nlmsvc_retry_blocked(); ! } /* * Find a socket with data available and call its *************** *** 163,168 **** --- 162,177 ---- dprintk("lockd: request from %08x\n", (unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr)); + + /* We need to do the clear/grace period here and not before svc_recv() + * because svc_recv may sleep longer than the grace period and the + * first request may be falsely processed as if the server was in the + * grace period when it is not causing unnecessary delays. + * Juan C. Gomez j_carlos_gome@yahoo.com + */ + if (nlmsvc_grace_period && time_before(grace_period_expire, jiffies)){ + clear_grace_period(); + } /* * Look up the NFS client handle. The handle is needed for