Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/3] SUNRPC: have svc_recv() check kthread_should_stop()
Date: Sun, 10 Feb 2008 19:47:59 -0500	[thread overview]
Message-ID: <20080211004759.GD20829@fieldses.org> (raw)
In-Reply-To: <1202420095-5818-3-git-send-email-jlayton@redhat.com>

Another nit:

On Thu, Feb 07, 2008 at 04:34:54PM -0500, Jeff Layton wrote:
> diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> index ea377e0..a3165a2 100644
> --- a/net/sunrpc/svc_xprt.c
> +++ b/net/sunrpc/svc_xprt.c
> @@ -18,6 +18,7 @@
>  #include <linux/skbuff.h>
>  #include <linux/file.h>
>  #include <linux/freezer.h>
> +#include <linux/kthread.h>
>  #include <net/sock.h>
>  #include <net/checksum.h>
>  #include <net/ip.h>
> @@ -586,6 +587,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
>  		while (rqstp->rq_pages[i] == NULL) {
>  			struct page *p = alloc_page(GFP_KERNEL);
>  			if (!p) {
> +				if (kthread_should_stop())
> +					return -EINTR;
>  				int j = msecs_to_jiffies(500);
>  				schedule_timeout_uninterruptible(j);
>  			}

The compiler's whining about the mixed declarations and code, so I've
also done the following in my copy.

--b.

diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index a3165a2..53c8ea9 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -587,9 +587,9 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
 		while (rqstp->rq_pages[i] == NULL) {
 			struct page *p = alloc_page(GFP_KERNEL);
 			if (!p) {
+				int j = msecs_to_jiffies(500);
 				if (kthread_should_stop())
 					return -EINTR;
-				int j = msecs_to_jiffies(500);
 				schedule_timeout_uninterruptible(j);
 			}
 			rqstp->rq_pages[i] = p;

  parent reply	other threads:[~2008-02-11  0:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 21:34 [PATCH 0/3] NLM: convert lockd to kthreads (try #11) Jeff Layton
2008-02-07 21:34 ` [PATCH 1/3] SUNRPC: export svc_sock_update_bufs Jeff Layton
2008-02-07 21:34   ` [PATCH 2/3] SUNRPC: have svc_recv() check kthread_should_stop() Jeff Layton
2008-02-07 21:34     ` [PATCH 3/3] NLM: Convert lockd to use kthreads Jeff Layton
2008-02-11  0:47     ` J. Bruce Fields [this message]
2008-02-11 12:06       ` [PATCH 2/3] SUNRPC: have svc_recv() check kthread_should_stop() Jeff Layton
     [not found]         ` <20080211070606.635b57be-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-02-11 16:24           ` J. Bruce Fields

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=20080211004759.GD20829@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox