Commit dc9319f5a3e1f67d2a2fbf190e30f6d03f569fed
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux
Pull two nfsd bugfixes from Bruce Fields. * 'for-3.19' of git://linux-nfs.org/~bfields/linux: rpc: fix xdr_truncate_encode to handle buffer ending on page boundary nfsd: fix fi_delegees leak when fi_had_conflict returns true
Showing 2 changed files Side-by-side Diff
fs/nfsd/nfs4state.c
... | ... | @@ -3897,11 +3897,11 @@ |
3897 | 3897 | status = nfs4_setlease(dp); |
3898 | 3898 | goto out; |
3899 | 3899 | } |
3900 | - atomic_inc(&fp->fi_delegees); | |
3901 | 3900 | if (fp->fi_had_conflict) { |
3902 | 3901 | status = -EAGAIN; |
3903 | 3902 | goto out_unlock; |
3904 | 3903 | } |
3904 | + atomic_inc(&fp->fi_delegees); | |
3905 | 3905 | hash_delegation_locked(dp, fp); |
3906 | 3906 | status = 0; |
3907 | 3907 | out_unlock: |
net/sunrpc/xdr.c
... | ... | @@ -606,7 +606,7 @@ |
606 | 606 | struct kvec *head = buf->head; |
607 | 607 | struct kvec *tail = buf->tail; |
608 | 608 | int fraglen; |
609 | - int new, old; | |
609 | + int new; | |
610 | 610 | |
611 | 611 | if (len > buf->len) { |
612 | 612 | WARN_ON_ONCE(1); |
... | ... | @@ -629,8 +629,8 @@ |
629 | 629 | buf->len -= fraglen; |
630 | 630 | |
631 | 631 | new = buf->page_base + buf->page_len; |
632 | - old = new + fraglen; | |
633 | - xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT); | |
632 | + | |
633 | + xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT); | |
634 | 634 | |
635 | 635 | if (buf->page_len) { |
636 | 636 | xdr->p = page_address(*xdr->page_ptr); |