SUNRPC: Fix a bug in rpcauth_prune_expired
[safe/jmp/linux-2.6] / net / sunrpc / svc.c
index 952f206..d9017d6 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/kthread.h>
+#include <linux/slab.h>
 
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
@@ -133,7 +134,7 @@ svc_pool_map_choose_mode(void)
                return SVC_POOL_PERNODE;
        }
 
-       node = any_online_node(node_online_map);
+       node = first_online_node;
        if (nr_cpus_node(node) > 2) {
                /*
                 * Non-trivial SMP, or CONFIG_NUMA on
@@ -506,6 +507,10 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
 {
        unsigned int pages, arghi;
 
+       /* bc_xprt uses fore channel allocated buffers */
+       if (svc_is_backchannel(rqstp))
+               return 1;
+
        pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
                                       * We assume one is at most one page
                                       */
@@ -1103,8 +1108,9 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
                                procp->pc_release(rqstp, NULL, rqstp->rq_resp);
                        goto dropit;
                }
-               if (*statp == rpc_success && (xdr = procp->pc_encode)
-                && !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
+               if (*statp == rpc_success &&
+                   (xdr = procp->pc_encode) &&
+                   !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
                        dprintk("svc: failed to encode reply\n");
                        /* serv->sv_stats->rpcsystemerr++; */
                        *statp = rpc_system_err;