All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Olaf Kirch <okir@suse.de>
Cc: nfs@lists.sourceforge.net, linux-fsdevel@vger.kernel.org
Subject: [PATCH][RFC] sleep_on fixes for lockd
Date: Mon, 9 Feb 2004 12:38:24 +0100	[thread overview]
Message-ID: <20040209113824.GA16700@lst.de> (raw)
In-Reply-To: <20040209102801.GC21364@suse.de>

Here's another interesting one for you, this time in lockd:

nlmclnt_grace_wait() is completetly unused, removed.

nlmclnt_call() uses sleep_on_interruptible, but doesn't actually check
for signals, I've fixed it to use wait_event_interruptible and check
for signals, but again I'd prefer someone knowledgeable to take look
at what this actually was intended to do..


--- 1.8/fs/lockd/clntproc.c	Fri Feb  7 21:25:20 2003
+++ edited/fs/lockd/clntproc.c	Sat Feb  7 15:58:42 2004
@@ -195,19 +195,6 @@
 }
 
 /*
- * Wait while server is in grace period
- */
-static inline int
-nlmclnt_grace_wait(struct nlm_host *host)
-{
-	if (!host->h_reclaiming)
-		interruptible_sleep_on_timeout(&host->h_gracewait, 10*HZ);
-	else
-		interruptible_sleep_on(&host->h_gracewait);
-	return signalled()? -ERESTARTSYS : 0;
-}
-
-/*
  * Allocate an NLM RPC call struct
  */
 struct nlm_rqst *
@@ -254,8 +241,11 @@
 		msg.rpc_cred = nfs_file_cred(filp);
 
 	do {
-		if (host->h_reclaiming && !argp->reclaim) {
-			interruptible_sleep_on(&host->h_gracewait);
+		status = wait_event_interruptible(host->h_gracewait,
+				(!host->h_reclaiming || argp->reclaim));
+		if (status) {
+			if (signalled())
+				return -EINTR;
 			continue;
 		}
 

  reply	other threads:[~2004-02-09 11:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-07 14:44 [PATCH][RFC] use completions instead of sleep_on for rpciod Christoph Hellwig
2004-02-08 20:43 ` David S. Miller
2004-02-09 10:28 ` Olaf Kirch
2004-02-09 11:38   ` Christoph Hellwig [this message]
2004-02-09 20:48   ` [NFS] [PATCH][RFC] use completions instead of sleep_on forrpciod trond.myklebust
2004-02-09 20:48     ` trond.myklebust
2004-02-09 21:00     ` David S. Miller
2004-02-10  9:15     ` Olaf Kirch
2004-02-10 11:47       ` trond.myklebust
2004-02-10 11:47         ` trond.myklebust
2004-02-10  1:52   ` [NFS] [PATCH][RFC] use completions instead of sleep_on for rpciod Greg Banks
2004-02-10  9:18     ` Olaf Kirch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040209113824.GA16700@lst.de \
    --to=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=okir@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.