aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/addr.c8
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c11
-rw-r--r--net/sunrpc/rpc_pipe.c11
-rw-r--r--net/sunrpc/svc.c6
-rw-r--r--net/sunrpc/xprtsock.c9
5 files changed, 28 insertions, 17 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index 6dcdd2517819..f845d9d72f73 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -71,8 +71,9 @@ static size_t rpc_ntop6(const struct sockaddr *sap,
71 if (unlikely(len == 0)) 71 if (unlikely(len == 0))
72 return len; 72 return len;
73 73
74 if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) && 74 if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL))
75 !(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_SITELOCAL)) 75 return len;
76 if (sin6->sin6_scope_id == 0)
76 return len; 77 return len;
77 78
78 rc = snprintf(scopebuf, sizeof(scopebuf), "%c%u", 79 rc = snprintf(scopebuf, sizeof(scopebuf), "%c%u",
@@ -165,8 +166,7 @@ static int rpc_parse_scope_id(const char *buf, const size_t buflen,
165 if (*delim != IPV6_SCOPE_DELIMITER) 166 if (*delim != IPV6_SCOPE_DELIMITER)
166 return 0; 167 return 0;
167 168
168 if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) && 169 if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL))
169 !(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_SITELOCAL))
170 return 0; 170 return 0;
171 171
172 len = (buf + buflen) - delim - 1; 172 len = (buf + buflen) - delim - 1;
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index f7a7f8380e38..0cfccc2a0297 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -206,8 +206,14 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
206 ctx->gc_win = window_size; 206 ctx->gc_win = window_size;
207 /* gssd signals an error by passing ctx->gc_win = 0: */ 207 /* gssd signals an error by passing ctx->gc_win = 0: */
208 if (ctx->gc_win == 0) { 208 if (ctx->gc_win == 0) {
209 /* in which case, p points to an error code which we ignore */ 209 /*
210 p = ERR_PTR(-EACCES); 210 * in which case, p points to an error code. Anything other
211 * than -EKEYEXPIRED gets converted to -EACCES.
212 */
213 p = simple_get_bytes(p, end, &ret, sizeof(ret));
214 if (!IS_ERR(p))
215 p = (ret == -EKEYEXPIRED) ? ERR_PTR(-EKEYEXPIRED) :
216 ERR_PTR(-EACCES);
211 goto err; 217 goto err;
212 } 218 }
213 /* copy the opaque wire context */ 219 /* copy the opaque wire context */
@@ -646,6 +652,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
646 err = PTR_ERR(p); 652 err = PTR_ERR(p);
647 switch (err) { 653 switch (err) {
648 case -EACCES: 654 case -EACCES:
655 case -EKEYEXPIRED:
649 gss_msg->msg.errno = err; 656 gss_msg->msg.errno = err;
650 err = mlen; 657 err = mlen;
651 break; 658 break;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 49278f830367..8d63f8fd29b7 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -78,7 +78,7 @@ rpc_timeout_upcall_queue(struct work_struct *work)
78} 78}
79 79
80/** 80/**
81 * rpc_queue_upcall 81 * rpc_queue_upcall - queue an upcall message to userspace
82 * @inode: inode of upcall pipe on which to queue given message 82 * @inode: inode of upcall pipe on which to queue given message
83 * @msg: message to queue 83 * @msg: message to queue
84 * 84 *
@@ -999,19 +999,14 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
999 inode = rpc_get_inode(sb, S_IFDIR | 0755); 999 inode = rpc_get_inode(sb, S_IFDIR | 0755);
1000 if (!inode) 1000 if (!inode)
1001 return -ENOMEM; 1001 return -ENOMEM;
1002 root = d_alloc_root(inode); 1002 sb->s_root = root = d_alloc_root(inode);
1003 if (!root) { 1003 if (!root) {
1004 iput(inode); 1004 iput(inode);
1005 return -ENOMEM; 1005 return -ENOMEM;
1006 } 1006 }
1007 if (rpc_populate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF, NULL)) 1007 if (rpc_populate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF, NULL))
1008 goto out; 1008 return -ENOMEM;
1009 sb->s_root = root;
1010 return 0; 1009 return 0;
1011out:
1012 d_genocide(root);
1013 dput(root);
1014 return -ENOMEM;
1015} 1010}
1016 1011
1017static int 1012static int
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 538ca433a56c..8420a4205b76 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -133,7 +133,7 @@ svc_pool_map_choose_mode(void)
133 return SVC_POOL_PERNODE; 133 return SVC_POOL_PERNODE;
134 } 134 }
135 135
136 node = any_online_node(node_online_map); 136 node = first_online_node;
137 if (nr_cpus_node(node) > 2) { 137 if (nr_cpus_node(node) > 2) {
138 /* 138 /*
139 * Non-trivial SMP, or CONFIG_NUMA on 139 * Non-trivial SMP, or CONFIG_NUMA on
@@ -506,6 +506,10 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
506{ 506{
507 unsigned int pages, arghi; 507 unsigned int pages, arghi;
508 508
509 /* bc_xprt uses fore channel allocated buffers */
510 if (svc_is_backchannel(rqstp))
511 return 1;
512
509 pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. 513 pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
510 * We assume one is at most one page 514 * We assume one is at most one page
511 */ 515 */
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 3d739e5d15d8..712412982cee 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1912,6 +1912,11 @@ static void xs_tcp_setup_socket(struct rpc_xprt *xprt,
1912 case -EALREADY: 1912 case -EALREADY:
1913 xprt_clear_connecting(xprt); 1913 xprt_clear_connecting(xprt);
1914 return; 1914 return;
1915 case -EINVAL:
1916 /* Happens, for instance, if the user specified a link
1917 * local IPv6 address without a scope-id.
1918 */
1919 goto out;
1915 } 1920 }
1916out_eagain: 1921out_eagain:
1917 status = -EAGAIN; 1922 status = -EAGAIN;
@@ -2100,7 +2105,7 @@ static void xs_tcp_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
2100 * we allocate pages instead doing a kmalloc like rpc_malloc is because we want 2105 * we allocate pages instead doing a kmalloc like rpc_malloc is because we want
2101 * to use the server side send routines. 2106 * to use the server side send routines.
2102 */ 2107 */
2103void *bc_malloc(struct rpc_task *task, size_t size) 2108static void *bc_malloc(struct rpc_task *task, size_t size)
2104{ 2109{
2105 struct page *page; 2110 struct page *page;
2106 struct rpc_buffer *buf; 2111 struct rpc_buffer *buf;
@@ -2120,7 +2125,7 @@ void *bc_malloc(struct rpc_task *task, size_t size)
2120/* 2125/*
2121 * Free the space allocated in the bc_alloc routine 2126 * Free the space allocated in the bc_alloc routine
2122 */ 2127 */
2123void bc_free(void *buffer) 2128static void bc_free(void *buffer)
2124{ 2129{
2125 struct rpc_buffer *buf; 2130 struct rpc_buffer *buf;
2126 2131