diff options
Diffstat (limited to 'net/sunrpc/svc.c')
| -rw-r--r-- | net/sunrpc/svc.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 3ee7461926d8..dbf12ac5ecb7 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
| 22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
| 23 | #include <linux/nsproxy.h> | ||
| 24 | 23 | ||
| 25 | #include <linux/sunrpc/types.h> | 24 | #include <linux/sunrpc/types.h> |
| 26 | #include <linux/sunrpc/xdr.h> | 25 | #include <linux/sunrpc/xdr.h> |
| @@ -324,7 +323,9 @@ svc_pool_map_set_cpumask(struct task_struct *task, unsigned int pidx) | |||
| 324 | * The caller checks for sv_nrpools > 1, which | 323 | * The caller checks for sv_nrpools > 1, which |
| 325 | * implies that we've been initialized. | 324 | * implies that we've been initialized. |
| 326 | */ | 325 | */ |
| 327 | BUG_ON(m->count == 0); | 326 | WARN_ON_ONCE(m->count == 0); |
| 327 | if (m->count == 0) | ||
| 328 | return; | ||
| 328 | 329 | ||
| 329 | switch (m->mode) { | 330 | switch (m->mode) { |
| 330 | case SVC_POOL_PERCPU: | 331 | case SVC_POOL_PERCPU: |
| @@ -585,7 +586,9 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size, int node) | |||
| 585 | * We assume one is at most one page | 586 | * We assume one is at most one page |
| 586 | */ | 587 | */ |
| 587 | arghi = 0; | 588 | arghi = 0; |
| 588 | BUG_ON(pages > RPCSVC_MAXPAGES); | 589 | WARN_ON_ONCE(pages > RPCSVC_MAXPAGES); |
| 590 | if (pages > RPCSVC_MAXPAGES) | ||
| 591 | pages = RPCSVC_MAXPAGES; | ||
| 589 | while (pages) { | 592 | while (pages) { |
| 590 | struct page *p = alloc_pages_node(node, GFP_KERNEL, 0); | 593 | struct page *p = alloc_pages_node(node, GFP_KERNEL, 0); |
| 591 | if (!p) | 594 | if (!p) |
| @@ -946,7 +949,9 @@ int svc_register(const struct svc_serv *serv, struct net *net, | |||
| 946 | unsigned int i; | 949 | unsigned int i; |
| 947 | int error = 0; | 950 | int error = 0; |
| 948 | 951 | ||
| 949 | BUG_ON(proto == 0 && port == 0); | 952 | WARN_ON_ONCE(proto == 0 && port == 0); |
| 953 | if (proto == 0 && port == 0) | ||
| 954 | return -EINVAL; | ||
| 950 | 955 | ||
| 951 | for (progp = serv->sv_program; progp; progp = progp->pg_next) { | 956 | for (progp = serv->sv_program; progp; progp = progp->pg_next) { |
| 952 | for (i = 0; i < progp->pg_nvers; i++) { | 957 | for (i = 0; i < progp->pg_nvers; i++) { |
| @@ -1035,7 +1040,7 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net) | |||
| 1035 | } | 1040 | } |
| 1036 | 1041 | ||
| 1037 | /* | 1042 | /* |
| 1038 | * Printk the given error with the address of the client that caused it. | 1043 | * dprintk the given error with the address of the client that caused it. |
| 1039 | */ | 1044 | */ |
| 1040 | static __printf(2, 3) | 1045 | static __printf(2, 3) |
| 1041 | void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) | 1046 | void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) |
| @@ -1049,8 +1054,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) | |||
| 1049 | vaf.fmt = fmt; | 1054 | vaf.fmt = fmt; |
| 1050 | vaf.va = &args; | 1055 | vaf.va = &args; |
| 1051 | 1056 | ||
| 1052 | net_warn_ratelimited("svc: %s: %pV", | 1057 | dprintk("svc: %s: %pV", svc_print_addr(rqstp, buf, sizeof(buf)), &vaf); |
| 1053 | svc_print_addr(rqstp, buf, sizeof(buf)), &vaf); | ||
| 1054 | 1058 | ||
| 1055 | va_end(args); | 1059 | va_end(args); |
| 1056 | } | 1060 | } |
| @@ -1299,7 +1303,7 @@ svc_process(struct svc_rqst *rqstp) | |||
| 1299 | * Setup response xdr_buf. | 1303 | * Setup response xdr_buf. |
| 1300 | * Initially it has just one page | 1304 | * Initially it has just one page |
| 1301 | */ | 1305 | */ |
| 1302 | rqstp->rq_resused = 1; | 1306 | rqstp->rq_next_page = &rqstp->rq_respages[1]; |
| 1303 | resv->iov_base = page_address(rqstp->rq_respages[0]); | 1307 | resv->iov_base = page_address(rqstp->rq_respages[0]); |
| 1304 | resv->iov_len = 0; | 1308 | resv->iov_len = 0; |
| 1305 | rqstp->rq_res.pages = rqstp->rq_respages + 1; | 1309 | rqstp->rq_res.pages = rqstp->rq_respages + 1; |
