aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/backchannel_rqst.c9
-rw-r--r--net/sunrpc/clnt.c2
-rw-r--r--net/sunrpc/rpc_pipe.c12
-rw-r--r--net/sunrpc/svc.c3
-rw-r--r--net/sunrpc/svcauth_unix.c22
-rw-r--r--net/sunrpc/svcsock.c12
-rw-r--r--net/sunrpc/xdr.c12
-rw-r--r--net/sunrpc/xprt.c2
-rw-r--r--net/sunrpc/xprtsock.c3
9 files changed, 32 insertions, 45 deletions
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 31def68a0f6e..5a3d675d2f2f 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -176,13 +176,14 @@ out_free:
176} 176}
177EXPORT_SYMBOL_GPL(xprt_setup_backchannel); 177EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
178 178
179/* 179/**
180 * Destroys the backchannel preallocated structures. 180 * xprt_destroy_backchannel - Destroys the backchannel preallocated structures.
181 * @xprt: the transport holding the preallocated strucures
182 * @max_reqs the maximum number of preallocated structures to destroy
183 *
181 * Since these structures may have been allocated by multiple calls 184 * Since these structures may have been allocated by multiple calls
182 * to xprt_setup_backchannel, we only destroy up to the maximum number 185 * to xprt_setup_backchannel, we only destroy up to the maximum number
183 * of reqs specified by the caller. 186 * of reqs specified by the caller.
184 * @xprt: the transport holding the preallocated strucures
185 * @max_reqs the maximum number of preallocated structures to destroy
186 */ 187 */
187void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs) 188void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs)
188{ 189{
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index f56f045778ae..00eb859b7de5 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -385,7 +385,7 @@ out_no_rpciod:
385 return ERR_PTR(err); 385 return ERR_PTR(err);
386} 386}
387 387
388/* 388/**
389 * rpc_create - create an RPC client and transport with one call 389 * rpc_create - create an RPC client and transport with one call
390 * @args: rpc_clnt create argument structure 390 * @args: rpc_clnt create argument structure
391 * 391 *
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 04040476082e..21fde99e5c56 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -71,7 +71,9 @@ static void rpc_purge_list(wait_queue_head_t *waitq, struct list_head *head,
71 msg->errno = err; 71 msg->errno = err;
72 destroy_msg(msg); 72 destroy_msg(msg);
73 } while (!list_empty(head)); 73 } while (!list_empty(head));
74 wake_up(waitq); 74
75 if (waitq)
76 wake_up(waitq);
75} 77}
76 78
77static void 79static void
@@ -91,11 +93,9 @@ rpc_timeout_upcall_queue(struct work_struct *work)
91 } 93 }
92 dentry = dget(pipe->dentry); 94 dentry = dget(pipe->dentry);
93 spin_unlock(&pipe->lock); 95 spin_unlock(&pipe->lock);
94 if (dentry) { 96 rpc_purge_list(dentry ? &RPC_I(dentry->d_inode)->waitq : NULL,
95 rpc_purge_list(&RPC_I(dentry->d_inode)->waitq, 97 &free_list, destroy_msg, -ETIMEDOUT);
96 &free_list, destroy_msg, -ETIMEDOUT); 98 dput(dentry);
97 dput(dentry);
98 }
99} 99}
100 100
101ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg, 101ssize_t rpc_pipe_generic_upcall(struct file *filp, struct rpc_pipe_msg *msg,
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 7e9baaa1e543..3ee7461926d8 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1374,7 +1374,8 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
1374 sizeof(req->rq_snd_buf)); 1374 sizeof(req->rq_snd_buf));
1375 return bc_send(req); 1375 return bc_send(req);
1376 } else { 1376 } else {
1377 /* Nothing to do to drop request */ 1377 /* drop request */
1378 xprt_free_bc_request(req);
1378 return 0; 1379 return 0;
1379 } 1380 }
1380} 1381}
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 2777fa896645..4d0129203733 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -104,23 +104,9 @@ static void ip_map_put(struct kref *kref)
104 kfree(im); 104 kfree(im);
105} 105}
106 106
107#if IP_HASHBITS == 8 107static inline int hash_ip6(const struct in6_addr *ip)
108/* hash_long on a 64 bit machine is currently REALLY BAD for
109 * IP addresses in reverse-endian (i.e. on a little-endian machine).
110 * So use a trivial but reliable hash instead
111 */
112static inline int hash_ip(__be32 ip)
113{
114 int hash = (__force u32)ip ^ ((__force u32)ip>>16);
115 return (hash ^ (hash>>8)) & 0xff;
116}
117#endif
118static inline int hash_ip6(struct in6_addr ip)
119{ 108{
120 return (hash_ip(ip.s6_addr32[0]) ^ 109 return hash_32(ipv6_addr_hash(ip), IP_HASHBITS);
121 hash_ip(ip.s6_addr32[1]) ^
122 hash_ip(ip.s6_addr32[2]) ^
123 hash_ip(ip.s6_addr32[3]));
124} 110}
125static int ip_map_match(struct cache_head *corig, struct cache_head *cnew) 111static int ip_map_match(struct cache_head *corig, struct cache_head *cnew)
126{ 112{
@@ -301,7 +287,7 @@ static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class,
301 ip.m_addr = *addr; 287 ip.m_addr = *addr;
302 ch = sunrpc_cache_lookup(cd, &ip.h, 288 ch = sunrpc_cache_lookup(cd, &ip.h,
303 hash_str(class, IP_HASHBITS) ^ 289 hash_str(class, IP_HASHBITS) ^
304 hash_ip6(*addr)); 290 hash_ip6(addr));
305 291
306 if (ch) 292 if (ch)
307 return container_of(ch, struct ip_map, h); 293 return container_of(ch, struct ip_map, h);
@@ -331,7 +317,7 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
331 ip.h.expiry_time = expiry; 317 ip.h.expiry_time = expiry;
332 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, 318 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h,
333 hash_str(ipm->m_class, IP_HASHBITS) ^ 319 hash_str(ipm->m_class, IP_HASHBITS) ^
334 hash_ip6(ipm->m_addr)); 320 hash_ip6(&ipm->m_addr));
335 if (!ch) 321 if (!ch)
336 return -ENOMEM; 322 return -ENOMEM;
337 cache_put(ch, cd); 323 cache_put(ch, cd);
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index a6de09de5d21..18bc130255a7 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -43,6 +43,7 @@
43#include <net/tcp_states.h> 43#include <net/tcp_states.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45#include <asm/ioctls.h> 45#include <asm/ioctls.h>
46#include <trace/events/skb.h>
46 47
47#include <linux/sunrpc/types.h> 48#include <linux/sunrpc/types.h>
48#include <linux/sunrpc/clnt.h> 49#include <linux/sunrpc/clnt.h>
@@ -619,6 +620,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
619 if (!svc_udp_get_dest_address(rqstp, cmh)) { 620 if (!svc_udp_get_dest_address(rqstp, cmh)) {
620 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n", 621 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n",
621 cmh->cmsg_level, cmh->cmsg_type); 622 cmh->cmsg_level, cmh->cmsg_type);
623out_free:
624 trace_kfree_skb(skb, svc_udp_recvfrom);
622 skb_free_datagram_locked(svsk->sk_sk, skb); 625 skb_free_datagram_locked(svsk->sk_sk, skb);
623 return 0; 626 return 0;
624 } 627 }
@@ -630,8 +633,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
630 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) { 633 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) {
631 local_bh_enable(); 634 local_bh_enable();
632 /* checksum error */ 635 /* checksum error */
633 skb_free_datagram_locked(svsk->sk_sk, skb); 636 goto out_free;
634 return 0;
635 } 637 }
636 local_bh_enable(); 638 local_bh_enable();
637 skb_free_datagram_locked(svsk->sk_sk, skb); 639 skb_free_datagram_locked(svsk->sk_sk, skb);
@@ -640,10 +642,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
640 rqstp->rq_arg.head[0].iov_base = skb->data + 642 rqstp->rq_arg.head[0].iov_base = skb->data +
641 sizeof(struct udphdr); 643 sizeof(struct udphdr);
642 rqstp->rq_arg.head[0].iov_len = len; 644 rqstp->rq_arg.head[0].iov_len = len;
643 if (skb_checksum_complete(skb)) { 645 if (skb_checksum_complete(skb))
644 skb_free_datagram_locked(svsk->sk_sk, skb); 646 goto out_free;
645 return 0;
646 }
647 rqstp->rq_xprt_ctxt = skb; 647 rqstp->rq_xprt_ctxt = skb;
648 } 648 }
649 649
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index fddcccfcdf76..0cf165580d8d 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -180,7 +180,9 @@ EXPORT_SYMBOL_GPL(xdr_inline_pages);
180 180
181/* 181/*
182 * Helper routines for doing 'memmove' like operations on a struct xdr_buf 182 * Helper routines for doing 'memmove' like operations on a struct xdr_buf
183 * 183 */
184
185/**
184 * _shift_data_right_pages 186 * _shift_data_right_pages
185 * @pages: vector of pages containing both the source and dest memory area. 187 * @pages: vector of pages containing both the source and dest memory area.
186 * @pgto_base: page vector address of destination 188 * @pgto_base: page vector address of destination
@@ -242,7 +244,7 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
242 } while ((len -= copy) != 0); 244 } while ((len -= copy) != 0);
243} 245}
244 246
245/* 247/**
246 * _copy_to_pages 248 * _copy_to_pages
247 * @pages: array of pages 249 * @pages: array of pages
248 * @pgbase: page vector address of destination 250 * @pgbase: page vector address of destination
@@ -286,7 +288,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
286 flush_dcache_page(*pgto); 288 flush_dcache_page(*pgto);
287} 289}
288 290
289/* 291/**
290 * _copy_from_pages 292 * _copy_from_pages
291 * @p: pointer to destination 293 * @p: pointer to destination
292 * @pages: array of pages 294 * @pages: array of pages
@@ -326,7 +328,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
326} 328}
327EXPORT_SYMBOL_GPL(_copy_from_pages); 329EXPORT_SYMBOL_GPL(_copy_from_pages);
328 330
329/* 331/**
330 * xdr_shrink_bufhead 332 * xdr_shrink_bufhead
331 * @buf: xdr_buf 333 * @buf: xdr_buf
332 * @len: bytes to remove from buf->head[0] 334 * @len: bytes to remove from buf->head[0]
@@ -399,7 +401,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
399 buf->len = buf->buflen; 401 buf->len = buf->buflen;
400} 402}
401 403
402/* 404/**
403 * xdr_shrink_pagelen 405 * xdr_shrink_pagelen
404 * @buf: xdr_buf 406 * @buf: xdr_buf
405 * @len: bytes to remove from buf->pages 407 * @len: bytes to remove from buf->pages
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 3c83035cdaa9..a5a402a7d21f 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -531,7 +531,7 @@ void xprt_set_retrans_timeout_def(struct rpc_task *task)
531} 531}
532EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def); 532EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def);
533 533
534/* 534/**
535 * xprt_set_retrans_timeout_rtt - set a request's retransmit timeout 535 * xprt_set_retrans_timeout_rtt - set a request's retransmit timeout
536 * @task: task whose timeout is to be set 536 * @task: task whose timeout is to be set
537 * 537 *
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 890b03f8d877..62d0dac8f780 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1014,9 +1014,6 @@ static void xs_udp_data_ready(struct sock *sk, int len)
1014 1014
1015 UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); 1015 UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS);
1016 1016
1017 /* Something worked... */
1018 dst_confirm(skb_dst(skb));
1019
1020 xprt_adjust_cwnd(task, copied); 1017 xprt_adjust_cwnd(task, copied);
1021 xprt_complete_rqst(task, copied); 1018 xprt_complete_rqst(task, copied);
1022 1019