aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-13 17:56:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-15 13:45:03 -0400
commite87cc4728f0e2fb663e592a1141742b1d6c63256 (patch)
treeb8219696d37f0c8d0521d5853560b97fc96dc667 /net/sunrpc/svcsock.c
parent3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (diff)
net: Convert net_ratelimit uses to net_<level>_ratelimited
Standardize the net core ratelimited logging functions. Coalesce formats, align arguments. Change a printk then vprintk sequence to use printf extension %pV. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index f0132b2e875e..a6de09de5d21 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -617,11 +617,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
617 rqstp->rq_prot = IPPROTO_UDP; 617 rqstp->rq_prot = IPPROTO_UDP;
618 618
619 if (!svc_udp_get_dest_address(rqstp, cmh)) { 619 if (!svc_udp_get_dest_address(rqstp, cmh)) {
620 if (net_ratelimit()) 620 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n",
621 printk(KERN_WARNING 621 cmh->cmsg_level, cmh->cmsg_type);
622 "svc: received unknown control message %d/%d; "
623 "dropping RPC reply datagram\n",
624 cmh->cmsg_level, cmh->cmsg_type);
625 skb_free_datagram_locked(svsk->sk_sk, skb); 622 skb_free_datagram_locked(svsk->sk_sk, skb);
626 return 0; 623 return 0;
627 } 624 }
@@ -871,18 +868,17 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
871 if (err == -ENOMEM) 868 if (err == -ENOMEM)
872 printk(KERN_WARNING "%s: no more sockets!\n", 869 printk(KERN_WARNING "%s: no more sockets!\n",
873 serv->sv_name); 870 serv->sv_name);
874 else if (err != -EAGAIN && net_ratelimit()) 871 else if (err != -EAGAIN)
875 printk(KERN_WARNING "%s: accept failed (err %d)!\n", 872 net_warn_ratelimited("%s: accept failed (err %d)!\n",
876 serv->sv_name, -err); 873 serv->sv_name, -err);
877 return NULL; 874 return NULL;
878 } 875 }
879 set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); 876 set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags);
880 877
881 err = kernel_getpeername(newsock, sin, &slen); 878 err = kernel_getpeername(newsock, sin, &slen);
882 if (err < 0) { 879 if (err < 0) {
883 if (net_ratelimit()) 880 net_warn_ratelimited("%s: peername failed (err %d)!\n",
884 printk(KERN_WARNING "%s: peername failed (err %d)!\n", 881 serv->sv_name, -err);
885 serv->sv_name, -err);
886 goto failed; /* aborted connection or whatever */ 882 goto failed; /* aborted connection or whatever */
887 } 883 }
888 884
@@ -1012,19 +1008,15 @@ static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
1012 * bit set in the fragment length header. 1008 * bit set in the fragment length header.
1013 * But apparently no known nfs clients send fragmented 1009 * But apparently no known nfs clients send fragmented
1014 * records. */ 1010 * records. */
1015 if (net_ratelimit()) 1011 net_notice_ratelimited("RPC: multiple fragments per record not supported\n");
1016 printk(KERN_NOTICE "RPC: multiple fragments "
1017 "per record not supported\n");
1018 goto err_delete; 1012 goto err_delete;
1019 } 1013 }
1020 1014
1021 svsk->sk_reclen &= RPC_FRAGMENT_SIZE_MASK; 1015 svsk->sk_reclen &= RPC_FRAGMENT_SIZE_MASK;
1022 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); 1016 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen);
1023 if (svsk->sk_reclen > serv->sv_max_mesg) { 1017 if (svsk->sk_reclen > serv->sv_max_mesg) {
1024 if (net_ratelimit()) 1018 net_notice_ratelimited("RPC: fragment too large: 0x%08lx\n",
1025 printk(KERN_NOTICE "RPC: " 1019 (unsigned long)svsk->sk_reclen);
1026 "fragment too large: 0x%08lx\n",
1027 (unsigned long)svsk->sk_reclen);
1028 goto err_delete; 1020 goto err_delete;
1029 } 1021 }
1030 } 1022 }