svcrdma: Remove last two __GFP_NOFAIL call sites
authorChuck Lever <chuck.lever@oracle.com>
Thu, 7 Jan 2016 19:49:45 +0000 (14:49 -0500)
committerDoug Ledford <dledford@redhat.com>
Tue, 19 Jan 2016 20:30:48 +0000 (15:30 -0500)
Clean up.

These functions can otherwise fail, so check for page allocation
failures too.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c

index aeaec7aa34df607f2cb9947fda4a3016e7c983f6..de7df7b4d8556e4ceadceaa5ee7d2edd19691114 100644 (file)
@@ -598,7 +598,10 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
        inline_bytes = rqstp->rq_res.len;
 
        /* Create the RDMA response header */
-       res_page = alloc_page(GFP_KERNEL | __GFP_NOFAIL);
+       ret = -ENOMEM;
+       res_page = alloc_page(GFP_KERNEL);
+       if (!res_page)
+               goto err0;
        rdma_resp = page_address(res_page);
        reply_ary = svc_rdma_get_reply_array(rdma_argp);
        if (reply_ary)
index 20fc095d6b120ed851a8c5c18904411f6e650fa4..8b3ee04f5bb444f784147b0025d4ec7b80c303c8 100644 (file)
@@ -1445,7 +1445,9 @@ void svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
        int length;
        int ret;
 
-       p = alloc_page(GFP_KERNEL | __GFP_NOFAIL);
+       p = alloc_page(GFP_KERNEL);
+       if (!p)
+               return;
        va = page_address(p);
 
        /* XDR encode error */