Commit 4e4490d4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-4.20-1' of git://linux-nfs.org/~bfields/linux

Pull nfsd fixes from Bruce Fields:
 "Three nfsd bugfixes.

  None are new bugs, but they all take a little effort to hit, which
  might explain why they weren't found sooner"

* tag 'nfsd-4.20-1' of git://linux-nfs.org/~bfields/linux:
  SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()
  nfsd: COPY and CLONE operations require the saved filehandle to be set
  sunrpc: correct the computation for page_ptr when truncating
parents d41217aa 025911a5
...@@ -1038,6 +1038,9 @@ nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1038,6 +1038,9 @@ nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
{ {
__be32 status; __be32 status;
if (!cstate->save_fh.fh_dentry)
return nfserr_nofilehandle;
status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh, status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh,
src_stateid, RD_STATE, src, NULL); src_stateid, RD_STATE, src, NULL);
if (status) { if (status) {
......
...@@ -546,7 +546,7 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode); ...@@ -546,7 +546,7 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode);
static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
size_t nbytes) size_t nbytes)
{ {
static __be32 *p; __be32 *p;
int space_left; int space_left;
int frag1bytes, frag2bytes; int frag1bytes, frag2bytes;
...@@ -673,11 +673,10 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len) ...@@ -673,11 +673,10 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
WARN_ON_ONCE(xdr->iov); WARN_ON_ONCE(xdr->iov);
return; return;
} }
if (fraglen) { if (fraglen)
xdr->end = head->iov_base + head->iov_len; xdr->end = head->iov_base + head->iov_len;
xdr->page_ptr--;
}
/* (otherwise assume xdr->end is already set) */ /* (otherwise assume xdr->end is already set) */
xdr->page_ptr--;
head->iov_len = len; head->iov_len = len;
buf->len = len; buf->len = len;
xdr->p = head->iov_base + head->iov_len; xdr->p = head->iov_base + head->iov_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment