diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xdr.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index ca8a7958f4e6..349c98f9818b 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -189,7 +189,7 @@ svc_pool_map_init_percpu(struct svc_pool_map *m) | |||
189 | return err; | 189 | return err; |
190 | 190 | ||
191 | for_each_online_cpu(cpu) { | 191 | for_each_online_cpu(cpu) { |
192 | BUG_ON(pidx > maxpools); | 192 | BUG_ON(pidx >= maxpools); |
193 | m->to_pool[cpu] = pidx; | 193 | m->to_pool[cpu] = pidx; |
194 | m->pool_to[pidx] = cpu; | 194 | m->pool_to[pidx] = cpu; |
195 | pidx++; | 195 | pidx++; |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 290af97bf6f9..1cb61242e55e 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -617,9 +617,10 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
617 | fraglen = min_t(int, buf->len - len, tail->iov_len); | 617 | fraglen = min_t(int, buf->len - len, tail->iov_len); |
618 | tail->iov_len -= fraglen; | 618 | tail->iov_len -= fraglen; |
619 | buf->len -= fraglen; | 619 | buf->len -= fraglen; |
620 | if (tail->iov_len && buf->len == len) { | 620 | if (tail->iov_len) { |
621 | xdr->p = tail->iov_base + tail->iov_len; | 621 | xdr->p = tail->iov_base + tail->iov_len; |
622 | /* xdr->end, xdr->iov should be set already */ | 622 | WARN_ON_ONCE(!xdr->end); |
623 | WARN_ON_ONCE(!xdr->iov); | ||
623 | return; | 624 | return; |
624 | } | 625 | } |
625 | WARN_ON_ONCE(fraglen); | 626 | WARN_ON_ONCE(fraglen); |
@@ -631,11 +632,11 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) | |||
631 | old = new + fraglen; | 632 | old = new + fraglen; |
632 | xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); | 633 | xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); |
633 | 634 | ||
634 | if (buf->page_len && buf->len == len) { | 635 | if (buf->page_len) { |
635 | xdr->p = page_address(*xdr->page_ptr); | 636 | xdr->p = page_address(*xdr->page_ptr); |
636 | xdr->end = (void *)xdr->p + PAGE_SIZE; | 637 | xdr->end = (void *)xdr->p + PAGE_SIZE; |
637 | xdr->p = (void *)xdr->p + (new % PAGE_SIZE); | 638 | xdr->p = (void *)xdr->p + (new % PAGE_SIZE); |
638 | /* xdr->iov should already be NULL */ | 639 | WARN_ON_ONCE(xdr->iov); |
639 | return; | 640 | return; |
640 | } | 641 | } |
641 | if (fraglen) { | 642 | if (fraglen) { |