]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sunrpc/svc_xprt.c
SUNRPC: allow svc_recv to break out of 500ms sleep when alloc_page fails
[linux-2.6-omap-h63xx.git] / net / sunrpc / svc_xprt.c
index 2e5d43c39142cce0c0d9b60e51a2932f917a96cc..d8e8d79a84514aebcd003b65ef2cda5002bc391c 100644 (file)
@@ -587,10 +587,12 @@ 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())
+                               set_current_state(TASK_INTERRUPTIBLE);
+                               if (signalled() || kthread_should_stop()) {
+                                       set_current_state(TASK_RUNNING);
                                        return -EINTR;
-                               schedule_timeout_uninterruptible(j);
+                               }
+                               schedule_timeout(msecs_to_jiffies(500));
                        }
                        rqstp->rq_pages[i] = p;
                }