aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-02-07 23:03:11 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-07 23:03:11 -0500
commitd5112a4f31a361409d3c57dc9d58dd69f8014bef (patch)
tree64771300b2191cb94d9aaf60355661a01c2ccd1a /net/sunrpc
parent12e86f92fcfe4f0bcab0ad7fa4088a64c60d9b38 (diff)
parent5fad293bcbd48d9a2370020cf60e4b4a42559b12 (diff)
Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into for-2.6.21
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c8
-rw-r--r--net/sunrpc/sched.c3
-rw-r--r--net/sunrpc/svc.c32
-rw-r--r--net/sunrpc/svcsock.c14
4 files changed, 31 insertions, 26 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index aba528b9ae76..16c9fbc1db69 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -490,16 +490,14 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
490 490
491 /* Set up the call info struct and execute the task */ 491 /* Set up the call info struct and execute the task */
492 status = task->tk_status; 492 status = task->tk_status;
493 if (status != 0) { 493 if (status != 0)
494 rpc_release_task(task);
495 goto out; 494 goto out;
496 }
497 atomic_inc(&task->tk_count); 495 atomic_inc(&task->tk_count);
498 status = rpc_execute(task); 496 status = rpc_execute(task);
499 if (status == 0) 497 if (status == 0)
500 status = task->tk_status; 498 status = task->tk_status;
501 rpc_put_task(task);
502out: 499out:
500 rpc_put_task(task);
503 rpc_restore_sigmask(&oldset); 501 rpc_restore_sigmask(&oldset);
504 return status; 502 return status;
505} 503}
@@ -537,7 +535,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags,
537 if (status == 0) 535 if (status == 0)
538 rpc_execute(task); 536 rpc_execute(task);
539 else 537 else
540 rpc_release_task(task); 538 rpc_put_task(task);
541 539
542 rpc_restore_sigmask(&oldset); 540 rpc_restore_sigmask(&oldset);
543 return status; 541 return status;
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 79bc4cdf5d48..fc083f0b3544 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -42,6 +42,7 @@ static mempool_t *rpc_buffer_mempool __read_mostly;
42static void __rpc_default_timer(struct rpc_task *task); 42static void __rpc_default_timer(struct rpc_task *task);
43static void rpciod_killall(void); 43static void rpciod_killall(void);
44static void rpc_async_schedule(struct work_struct *); 44static void rpc_async_schedule(struct work_struct *);
45static void rpc_release_task(struct rpc_task *task);
45 46
46/* 47/*
47 * RPC tasks sit here while waiting for conditions to improve. 48 * RPC tasks sit here while waiting for conditions to improve.
@@ -896,7 +897,7 @@ void rpc_put_task(struct rpc_task *task)
896} 897}
897EXPORT_SYMBOL(rpc_put_task); 898EXPORT_SYMBOL(rpc_put_task);
898 899
899void rpc_release_task(struct rpc_task *task) 900static void rpc_release_task(struct rpc_task *task)
900{ 901{
901#ifdef RPC_DEBUG 902#ifdef RPC_DEBUG
902 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); 903 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index f3001f3626f6..4c1611211119 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -26,7 +26,6 @@
26#include <linux/sunrpc/clnt.h> 26#include <linux/sunrpc/clnt.h>
27 27
28#define RPCDBG_FACILITY RPCDBG_SVCDSP 28#define RPCDBG_FACILITY RPCDBG_SVCDSP
29#define RPC_PARANOIA 1
30 29
31/* 30/*
32 * Mode for mapping cpus to pools. 31 * Mode for mapping cpus to pools.
@@ -872,15 +871,15 @@ svc_process(struct svc_rqst *rqstp)
872 return 0; 871 return 0;
873 872
874err_short_len: 873err_short_len:
875#ifdef RPC_PARANOIA 874 if (net_ratelimit())
876 printk("svc: short len %Zd, dropping request\n", argv->iov_len); 875 printk("svc: short len %Zd, dropping request\n", argv->iov_len);
877#endif 876
878 goto dropit; /* drop request */ 877 goto dropit; /* drop request */
879 878
880err_bad_dir: 879err_bad_dir:
881#ifdef RPC_PARANOIA 880 if (net_ratelimit())
882 printk("svc: bad direction %d, dropping request\n", dir); 881 printk("svc: bad direction %d, dropping request\n", dir);
883#endif 882
884 serv->sv_stats->rpcbadfmt++; 883 serv->sv_stats->rpcbadfmt++;
885 goto dropit; /* drop request */ 884 goto dropit; /* drop request */
886 885
@@ -909,9 +908,10 @@ err_bad_prog:
909 goto sendit; 908 goto sendit;
910 909
911err_bad_vers: 910err_bad_vers:
912#ifdef RPC_PARANOIA 911 if (net_ratelimit())
913 printk("svc: unknown version (%d)\n", vers); 912 printk("svc: unknown version (%d for prog %d, %s)\n",
914#endif 913 vers, prog, progp->pg_name);
914
915 serv->sv_stats->rpcbadfmt++; 915 serv->sv_stats->rpcbadfmt++;
916 svc_putnl(resv, RPC_PROG_MISMATCH); 916 svc_putnl(resv, RPC_PROG_MISMATCH);
917 svc_putnl(resv, progp->pg_lovers); 917 svc_putnl(resv, progp->pg_lovers);
@@ -919,17 +919,17 @@ err_bad_vers:
919 goto sendit; 919 goto sendit;
920 920
921err_bad_proc: 921err_bad_proc:
922#ifdef RPC_PARANOIA 922 if (net_ratelimit())
923 printk("svc: unknown procedure (%d)\n", proc); 923 printk("svc: unknown procedure (%d)\n", proc);
924#endif 924
925 serv->sv_stats->rpcbadfmt++; 925 serv->sv_stats->rpcbadfmt++;
926 svc_putnl(resv, RPC_PROC_UNAVAIL); 926 svc_putnl(resv, RPC_PROC_UNAVAIL);
927 goto sendit; 927 goto sendit;
928 928
929err_garbage: 929err_garbage:
930#ifdef RPC_PARANOIA 930 if (net_ratelimit())
931 printk("svc: failed to decode args\n"); 931 printk("svc: failed to decode args\n");
932#endif 932
933 rpc_stat = rpc_garbage_args; 933 rpc_stat = rpc_garbage_args;
934err_bad: 934err_bad:
935 serv->sv_stats->rpcbadfmt++; 935 serv->sv_stats->rpcbadfmt++;
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 99f54fb6d669..ff1f8bf680aa 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1062,15 +1062,19 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
1062 * bit set in the fragment length header. 1062 * bit set in the fragment length header.
1063 * But apparently no known nfs clients send fragmented 1063 * But apparently no known nfs clients send fragmented
1064 * records. */ 1064 * records. */
1065 printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (non-terminal)\n", 1065 if (net_ratelimit())
1066 (unsigned long) svsk->sk_reclen); 1066 printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx"
1067 " (non-terminal)\n",
1068 (unsigned long) svsk->sk_reclen);
1067 goto err_delete; 1069 goto err_delete;
1068 } 1070 }
1069 svsk->sk_reclen &= 0x7fffffff; 1071 svsk->sk_reclen &= 0x7fffffff;
1070 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); 1072 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen);
1071 if (svsk->sk_reclen > serv->sv_max_mesg) { 1073 if (svsk->sk_reclen > serv->sv_max_mesg) {
1072 printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (large)\n", 1074 if (net_ratelimit())
1073 (unsigned long) svsk->sk_reclen); 1075 printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx"
1076 " (large)\n",
1077 (unsigned long) svsk->sk_reclen);
1074 goto err_delete; 1078 goto err_delete;
1075 } 1079 }
1076 } 1080 }
@@ -1278,6 +1282,8 @@ svc_recv(struct svc_rqst *rqstp, long timeout)
1278 schedule_timeout_uninterruptible(msecs_to_jiffies(500)); 1282 schedule_timeout_uninterruptible(msecs_to_jiffies(500));
1279 rqstp->rq_pages[i] = p; 1283 rqstp->rq_pages[i] = p;
1280 } 1284 }
1285 rqstp->rq_pages[i++] = NULL; /* this might be seen in nfs_read_actor */
1286 BUG_ON(pages >= RPCSVC_MAXPAGES);
1281 1287
1282 /* Make arg->head point to first page and arg->pages point to rest */ 1288 /* Make arg->head point to first page and arg->pages point to rest */
1283 arg = &rqstp->rq_arg; 1289 arg = &rqstp->rq_arg;