Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux
[firefly-linux-kernel-4.4.55.git] / net / sunrpc / xprtrdma / svc_rdma_recvfrom.c
index 41cb63b623dfa5033388740d454f937c84ae1db3..0ce75524ed2159982414da7cbf304a0ff3db7044 100644 (file)
@@ -521,11 +521,11 @@ next_sge:
                rqstp->rq_pages[ch_no] = NULL;
 
        /*
-        * Detach res pages. svc_release must see a resused count of
-        * zero or it will attempt to put them.
+        * Detach res pages. If svc_release sees any it will attempt to
+        * put them.
         */
-       while (rqstp->rq_resused)
-               rqstp->rq_respages[--rqstp->rq_resused] = NULL;
+       while (rqstp->rq_next_page != rqstp->rq_respages)
+               *(--rqstp->rq_next_page) = NULL;
 
        return err;
 }
@@ -550,7 +550,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
 
        /* rq_respages starts after the last arg page */
        rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
-       rqstp->rq_resused = 0;
+       rqstp->rq_next_page = &rqstp->rq_arg.pages[page_no];
 
        /* Rebuild rq_arg head and tail. */
        rqstp->rq_arg.head[0] = head->arg.head[0];