Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e4d6597 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull nfsd updates from Bruce Fields:
 "Chuck Lever did a bunch of work on nfsd tracepoints, on RDMA, and on
  server xdr decoding (with an eye towards eliminating a data copy in
  the RDMA case).

  I did some refactoring of the delegation code in preparation for
  eliminating some delegation self-conflicts and implementing write
  delegations"

* tag 'nfsd-4.17' of git://linux-nfs.org/~bfields/linux: (40 commits)
  nfsd: fix incorrect umasks
  sunrpc: remove incorrect HMAC request initialization
  NFSD: Clean up legacy NFS SYMLINK argument XDR decoders
  NFSD: Clean up legacy NFS WRITE argument XDR decoders
  nfsd: Trace NFSv4 COMPOUND execution
  nfsd: Add I/O trace points in the NFSv4 read proc
  nfsd: Add I/O trace points in the NFSv4 write path
  nfsd: Add "nfsd_" to trace point names
  nfsd: Record request byte count, not count of vectors
  nfsd: Fix NFSD trace points
  svc: Report xprt dequeue latency
  sunrpc: Report per-RPC execution stats
  sunrpc: Re-purpose trace_svc_process
  sunrpc: Save remote presentation address in svc_xprt for trace events
  sunrpc: Simplify trace_svc_recv
  sunrpc: Simplify do_enqueue tracing
  sunrpc: Move trace_svc_xprt_dequeue()
  sunrpc: Update show_svc_xprt_flags() to include recently added flags
  svc: Simplify ->xpo_secure_port
  sunrpc: Remove unneeded pointer dereference
  ...
parents 274c0e74 880a3a53
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -57,8 +57,8 @@ static struct task_struct *nlmsvc_task;
static struct svc_rqst		*nlmsvc_rqst;
static struct svc_rqst		*nlmsvc_rqst;
unsigned long			nlmsvc_timeout;
unsigned long			nlmsvc_timeout;


atomic_t nlm_ntf_refcnt = ATOMIC_INIT(0);
static atomic_t nlm_ntf_refcnt = ATOMIC_INIT(0);
DECLARE_WAIT_QUEUE_HEAD(nlm_ntf_wq);
static DECLARE_WAIT_QUEUE_HEAD(nlm_ntf_wq);


unsigned int lockd_net_id;
unsigned int lockd_net_id;


+16 −2
Original line number Original line Diff line number Diff line
@@ -192,6 +192,7 @@ nfsd3_proc_write(struct svc_rqst *rqstp)
	struct nfsd3_writeres *resp = rqstp->rq_resp;
	struct nfsd3_writeres *resp = rqstp->rq_resp;
	__be32	nfserr;
	__be32	nfserr;
	unsigned long cnt = argp->len;
	unsigned long cnt = argp->len;
	unsigned int nvecs;


	dprintk("nfsd: WRITE(3)    %s %d bytes at %Lu%s\n",
	dprintk("nfsd: WRITE(3)    %s %d bytes at %Lu%s\n",
				SVCFH_fmt(&argp->fh),
				SVCFH_fmt(&argp->fh),
@@ -201,9 +202,12 @@ nfsd3_proc_write(struct svc_rqst *rqstp)


	fh_copy(&resp->fh, &argp->fh);
	fh_copy(&resp->fh, &argp->fh);
	resp->committed = argp->stable;
	resp->committed = argp->stable;
	nvecs = svc_fill_write_vector(rqstp, &argp->first, cnt);
	if (!nvecs)
		RETURN_STATUS(nfserr_io);
	nfserr = nfsd_write(rqstp, &resp->fh, argp->offset,
	nfserr = nfsd_write(rqstp, &resp->fh, argp->offset,
				rqstp->rq_vec, argp->vlen,
			    rqstp->rq_vec, nvecs, &cnt,
				&cnt, resp->committed);
			    resp->committed);
	resp->count = cnt;
	resp->count = cnt;
	RETURN_STATUS(nfserr);
	RETURN_STATUS(nfserr);
}
}
@@ -279,6 +283,16 @@ nfsd3_proc_symlink(struct svc_rqst *rqstp)
	struct nfsd3_diropres *resp = rqstp->rq_resp;
	struct nfsd3_diropres *resp = rqstp->rq_resp;
	__be32	nfserr;
	__be32	nfserr;


	if (argp->tlen == 0)
		RETURN_STATUS(nfserr_inval);
	if (argp->tlen > NFS3_MAXPATHLEN)
		RETURN_STATUS(nfserr_nametoolong);

	argp->tname = svc_fill_symlink_pathname(rqstp, &argp->first,
						argp->tlen);
	if (IS_ERR(argp->tname))
		RETURN_STATUS(nfserrno(PTR_ERR(argp->tname)));

	dprintk("nfsd: SYMLINK(3)  %s %.*s -> %.*s\n",
	dprintk("nfsd: SYMLINK(3)  %s %.*s -> %.*s\n",
				SVCFH_fmt(&argp->ffh),
				SVCFH_fmt(&argp->ffh),
				argp->flen, argp->fname,
				argp->flen, argp->fname,
+16 −51
Original line number Original line Diff line number Diff line
@@ -391,7 +391,7 @@ int
nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
{
{
	struct nfsd3_writeargs *args = rqstp->rq_argp;
	struct nfsd3_writeargs *args = rqstp->rq_argp;
	unsigned int len, v, hdr, dlen;
	unsigned int len, hdr, dlen;
	u32 max_blocksize = svc_max_payload(rqstp);
	u32 max_blocksize = svc_max_payload(rqstp);
	struct kvec *head = rqstp->rq_arg.head;
	struct kvec *head = rqstp->rq_arg.head;
	struct kvec *tail = rqstp->rq_arg.tail;
	struct kvec *tail = rqstp->rq_arg.tail;
@@ -433,17 +433,9 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
		args->count = max_blocksize;
		args->count = max_blocksize;
		len = args->len = max_blocksize;
		len = args->len = max_blocksize;
	}
	}
	rqstp->rq_vec[0].iov_base = (void*)p;

	rqstp->rq_vec[0].iov_len = head->iov_len - hdr;
	args->first.iov_base = (void *)p;
	v = 0;
	args->first.iov_len = head->iov_len - hdr;
	while (len > rqstp->rq_vec[v].iov_len) {
		len -= rqstp->rq_vec[v].iov_len;
		v++;
		rqstp->rq_vec[v].iov_base = page_address(rqstp->rq_pages[v]);
		rqstp->rq_vec[v].iov_len = PAGE_SIZE;
	}
	rqstp->rq_vec[v].iov_len = len;
	args->vlen = v + 1;
	return 1;
	return 1;
}
}


@@ -489,51 +481,24 @@ int
nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
{
{
	struct nfsd3_symlinkargs *args = rqstp->rq_argp;
	struct nfsd3_symlinkargs *args = rqstp->rq_argp;
	unsigned int len, avail;
	char *base = (char *)p;
	char *old, *new;
	size_t dlen;
	struct kvec *vec;


	if (!(p = decode_fh(p, &args->ffh)) ||
	if (!(p = decode_fh(p, &args->ffh)) ||
	    !(p = decode_filename(p, &args->fname, &args->flen))
	    !(p = decode_filename(p, &args->fname, &args->flen)))
		)
		return 0;
		return 0;
	p = decode_sattr3(p, &args->attrs);
	p = decode_sattr3(p, &args->attrs);


	/* now decode the pathname, which might be larger than the first page.
	args->tlen = ntohl(*p++);
	 * As we have to check for nul's anyway, we copy it into a new page
	 * This page appears in the rq_res.pages list, but as pages_len is always
	 * 0, it won't get in the way
	 */
	len = ntohl(*p++);
	if (len == 0 || len > NFS3_MAXPATHLEN || len >= PAGE_SIZE)
		return 0;
	args->tname = new = page_address(*(rqstp->rq_next_page++));
	args->tlen = len;
	/* first copy and check from the first page */
	old = (char*)p;
	vec = &rqstp->rq_arg.head[0];
	if ((void *)old > vec->iov_base + vec->iov_len)
		return 0;
	avail = vec->iov_len - (old - (char*)vec->iov_base);
	while (len && avail && *old) {
		*new++ = *old++;
		len--;
		avail--;
	}
	/* now copy next page if there is one */
	if (len && !avail && rqstp->rq_arg.page_len) {
		avail = min_t(unsigned int, rqstp->rq_arg.page_len, PAGE_SIZE);
		old = page_address(rqstp->rq_arg.pages[0]);
	}
	while (len && avail && *old) {
		*new++ = *old++;
		len--;
		avail--;
	}
	*new = '\0';
	if (len)
		return 0;


	args->first.iov_base = p;
	args->first.iov_len = rqstp->rq_arg.head[0].iov_len;
	args->first.iov_len -= (char *)p - base;

	dlen = args->first.iov_len + rqstp->rq_arg.page_len +
	       rqstp->rq_arg.tail[0].iov_len;
	if (dlen < XDR_QUADLEN(args->tlen) << 2)
		return 0;
	return 1;
	return 1;
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -223,8 +223,8 @@ static int nfs_cb_stat_to_errno(int status)
	return -status;
	return -status;
}
}


static int decode_cb_op_status(struct xdr_stream *xdr, enum nfs_opnum4 expected,
static int decode_cb_op_status(struct xdr_stream *xdr,
			       int *status)
			       enum nfs_cb_opnum4 expected, int *status)
{
{
	__be32 *p;
	__be32 *p;
	u32 op;
	u32 op;
+8 −8
Original line number Original line Diff line number Diff line
@@ -165,7 +165,7 @@ nfsd4_free_layout_stateid(struct nfs4_stid *stid)
	struct nfs4_client *clp = ls->ls_stid.sc_client;
	struct nfs4_client *clp = ls->ls_stid.sc_client;
	struct nfs4_file *fp = ls->ls_stid.sc_file;
	struct nfs4_file *fp = ls->ls_stid.sc_file;


	trace_layoutstate_free(&ls->ls_stid.sc_stateid);
	trace_nfsd_layoutstate_free(&ls->ls_stid.sc_stateid);


	spin_lock(&clp->cl_lock);
	spin_lock(&clp->cl_lock);
	list_del_init(&ls->ls_perclnt);
	list_del_init(&ls->ls_perclnt);
@@ -264,7 +264,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
	list_add(&ls->ls_perfile, &fp->fi_lo_states);
	list_add(&ls->ls_perfile, &fp->fi_lo_states);
	spin_unlock(&fp->fi_lock);
	spin_unlock(&fp->fi_lock);


	trace_layoutstate_alloc(&ls->ls_stid.sc_stateid);
	trace_nfsd_layoutstate_alloc(&ls->ls_stid.sc_stateid);
	return ls;
	return ls;
}
}


@@ -334,7 +334,7 @@ nfsd4_recall_file_layout(struct nfs4_layout_stateid *ls)
	if (list_empty(&ls->ls_layouts))
	if (list_empty(&ls->ls_layouts))
		goto out_unlock;
		goto out_unlock;


	trace_layout_recall(&ls->ls_stid.sc_stateid);
	trace_nfsd_layout_recall(&ls->ls_stid.sc_stateid);


	refcount_inc(&ls->ls_stid.sc_count);
	refcount_inc(&ls->ls_stid.sc_count);
	nfsd4_run_cb(&ls->ls_recall);
	nfsd4_run_cb(&ls->ls_recall);
@@ -507,7 +507,7 @@ nfsd4_return_file_layouts(struct svc_rqst *rqstp,
						false, lrp->lr_layout_type,
						false, lrp->lr_layout_type,
						&ls);
						&ls);
	if (nfserr) {
	if (nfserr) {
		trace_layout_return_lookup_fail(&lrp->lr_sid);
		trace_nfsd_layout_return_lookup_fail(&lrp->lr_sid);
		return nfserr;
		return nfserr;
	}
	}


@@ -523,7 +523,7 @@ nfsd4_return_file_layouts(struct svc_rqst *rqstp,
			nfs4_inc_and_copy_stateid(&lrp->lr_sid, &ls->ls_stid);
			nfs4_inc_and_copy_stateid(&lrp->lr_sid, &ls->ls_stid);
		lrp->lrs_present = 1;
		lrp->lrs_present = 1;
	} else {
	} else {
		trace_layoutstate_unhash(&ls->ls_stid.sc_stateid);
		trace_nfsd_layoutstate_unhash(&ls->ls_stid.sc_stateid);
		nfs4_unhash_stid(&ls->ls_stid);
		nfs4_unhash_stid(&ls->ls_stid);
		lrp->lrs_present = 0;
		lrp->lrs_present = 0;
	}
	}
@@ -694,7 +694,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
		/*
		/*
		 * Unknown error or non-responding client, we'll need to fence.
		 * Unknown error or non-responding client, we'll need to fence.
		 */
		 */
		trace_layout_recall_fail(&ls->ls_stid.sc_stateid);
		trace_nfsd_layout_recall_fail(&ls->ls_stid.sc_stateid);


		ops = nfsd4_layout_ops[ls->ls_layout_type];
		ops = nfsd4_layout_ops[ls->ls_layout_type];
		if (ops->fence_client)
		if (ops->fence_client)
@@ -703,7 +703,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
			nfsd4_cb_layout_fail(ls);
			nfsd4_cb_layout_fail(ls);
		return -1;
		return -1;
	case -NFS4ERR_NOMATCHING_LAYOUT:
	case -NFS4ERR_NOMATCHING_LAYOUT:
		trace_layout_recall_done(&ls->ls_stid.sc_stateid);
		trace_nfsd_layout_recall_done(&ls->ls_stid.sc_stateid);
		task->tk_status = 0;
		task->tk_status = 0;
		return 1;
		return 1;
	}
	}
@@ -716,7 +716,7 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb)
		container_of(cb, struct nfs4_layout_stateid, ls_recall);
		container_of(cb, struct nfs4_layout_stateid, ls_recall);
	LIST_HEAD(reaplist);
	LIST_HEAD(reaplist);


	trace_layout_recall_release(&ls->ls_stid.sc_stateid);
	trace_nfsd_layout_recall_release(&ls->ls_stid.sc_stateid);


	nfsd4_return_all_layouts(ls, &reaplist);
	nfsd4_return_all_layouts(ls, &reaplist);
	nfsd4_free_layouts(&reaplist);
	nfsd4_free_layouts(&reaplist);
Loading