lkml.org 
[lkml]   [2002]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] Fix problem with lcokd grace period checking.
On Wednesday October 16, juang@us.ibm.com wrote:
>
> In an effort to avoid this patch to die before in someone's mailbox I am
> bringing it back....
> As requested by Linus I am forwarding this to you Neil for review/inclusion
> in a soon-to-be released 2.5.* version

I made a few cosmetic changes, and move the comment into the changelog..

NeilBrown

###Comments for ChangeSet

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 was not
causing unnecessary delays for the first request received.
* Juan C. Gomez j_carlos_gome@yahoo.com

Also opencode trivial clear_grace_period function.

----------- Diffstat output ------------
./fs/lockd/svc.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

--- ./fs/lockd/svc.c 2002/10/16 04:45:57 1.2
+++ ./fs/lockd/svc.c 2002/10/17 01:53:15 1.3
@@ -72,11 +72,6 @@ static unsigned long set_grace_period(vo
return grace_period + jiffies;
}

-static inline void clear_grace_period(void)
-{
- nlmsvc_grace_period = 0;
-}
-
/*
* This is the lockd kernel thread
*/
@@ -141,10 +136,8 @@ lockd(struct svc_rqst *rqstp)
* (Theoretically, there shouldn't even be blocked locks
* during grace period).
*/
- if (!nlmsvc_grace_period) {
+ 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
@@ -163,6 +156,9 @@ lockd(struct svc_rqst *rqstp)
dprintk("lockd: request from %08x\n",
(unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr));

+ if (nlmsvc_grace_period &&
+ time_before(grace_period_expire, jiffies))
+ nlmsvc_grace_period = 0;
svc_process(serv, rqstp);

}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.037 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site