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
This commit is contained in:
commit
dc9319f5a3
|
@ -3897,11 +3897,11 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
|
||||||
status = nfs4_setlease(dp);
|
status = nfs4_setlease(dp);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
atomic_inc(&fp->fi_delegees);
|
|
||||||
if (fp->fi_had_conflict) {
|
if (fp->fi_had_conflict) {
|
||||||
status = -EAGAIN;
|
status = -EAGAIN;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
atomic_inc(&fp->fi_delegees);
|
||||||
hash_delegation_locked(dp, fp);
|
hash_delegation_locked(dp, fp);
|
||||||
status = 0;
|
status = 0;
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
|
|
@ -606,7 +606,7 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
|
||||||
struct kvec *head = buf->head;
|
struct kvec *head = buf->head;
|
||||||
struct kvec *tail = buf->tail;
|
struct kvec *tail = buf->tail;
|
||||||
int fraglen;
|
int fraglen;
|
||||||
int new, old;
|
int new;
|
||||||
|
|
||||||
if (len > buf->len) {
|
if (len > buf->len) {
|
||||||
WARN_ON_ONCE(1);
|
WARN_ON_ONCE(1);
|
||||||
|
@ -629,8 +629,8 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
|
||||||
buf->len -= fraglen;
|
buf->len -= fraglen;
|
||||||
|
|
||||||
new = buf->page_base + buf->page_len;
|
new = buf->page_base + buf->page_len;
|
||||||
old = new + fraglen;
|
|
||||||
xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT);
|
xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT);
|
||||||
|
|
||||||
if (buf->page_len) {
|
if (buf->page_len) {
|
||||||
xdr->p = page_address(*xdr->page_ptr);
|
xdr->p = page_address(*xdr->page_ptr);
|
||||||
|
|
Loading…
Reference in New Issue