Merge tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
[linux-2.6-microblaze.git] / net / sunrpc / svc_xprt.c
index e1153cb..6316bd2 100644 (file)
@@ -663,7 +663,7 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
 {
        struct svc_serv *serv = rqstp->rq_server;
        struct xdr_buf *arg = &rqstp->rq_arg;
 {
        struct svc_serv *serv = rqstp->rq_server;
        struct xdr_buf *arg = &rqstp->rq_arg;
-       unsigned long pages, filled;
+       unsigned long pages, filled, ret;
 
        pagevec_init(&rqstp->rq_pvec);
 
 
        pagevec_init(&rqstp->rq_pvec);
 
@@ -675,11 +675,12 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
                pages = RPCSVC_MAXPAGES;
        }
 
                pages = RPCSVC_MAXPAGES;
        }
 
-       for (;;) {
-               filled = alloc_pages_bulk_array(GFP_KERNEL, pages,
-                                               rqstp->rq_pages);
-               if (filled == pages)
-                       break;
+       for (filled = 0; filled < pages; filled = ret) {
+               ret = alloc_pages_bulk_array(GFP_KERNEL, pages,
+                                            rqstp->rq_pages);
+               if (ret > filled)
+                       /* Made progress, don't sleep yet */
+                       continue;
 
                set_current_state(TASK_INTERRUPTIBLE);
                if (signalled() || kthread_should_stop()) {
 
                set_current_state(TASK_INTERRUPTIBLE);
                if (signalled() || kthread_should_stop()) {