All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: "trondmy@kernel.org" <trondmy@kernel.org>
Cc: Bruce Fields <bfields@redhat.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2 06/10] nfsd: NFSv3 should allow zero length writes
Date: Sun, 19 Dec 2021 20:11:28 +0000	[thread overview]
Message-ID: <26FE2634-B4BC-4E90-AE2D-9B37A2F4D8B2@oracle.com> (raw)
In-Reply-To: <20211219013803.324724-7-trondmy@kernel.org>



> On Dec 18, 2021, at 8:37 PM, trondmy@kernel.org wrote:
> 
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> According to RFC1813: "If count is 0, the WRITE will succeed
> and return a count of 0, barring errors due to permissions checking."

If you resend this series, please move this patch to the front.


> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
> fs/nfsd/vfs.c    | 3 +++
> net/sunrpc/svc.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index eb9818432149..85e579aa6944 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -967,6 +967,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
> 
> 	trace_nfsd_write_opened(rqstp, fhp, offset, *cnt);
> 
> +	if (!*cnt)
> +		return nfs_ok;
> +
> 	if (sb->s_export_op)
> 		exp_op_flags = sb->s_export_op->flags;
> 
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 4292278a9552..72a7822fd257 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -1638,7 +1638,7 @@ unsigned int svc_fill_write_vector(struct svc_rqst *rqstp,
> 	 * entirely in rq_arg.pages. In this case, @first is empty.
> 	 */
> 	i = 0;
> -	if (first->iov_len) {
> +	if (first->iov_len || !total) {
> 		vec[i].iov_base = first->iov_base;
> 		vec[i].iov_len = min_t(size_t, total, first->iov_len);
> 		total -= vec[i].iov_len;
> -- 
> 2.33.1
> 

--
Chuck Lever




  parent reply	other threads:[~2021-12-19 20:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19  1:37 [PATCH v2 00/10] Assorted patches for knfsd trondmy
2021-12-19  1:37 ` [PATCH v2 01/10] nfsd: map EBADF trondmy
2021-12-19  1:37   ` [PATCH v2 02/10] nfsd: Add errno mapping for EREMOTEIO trondmy
2021-12-19  1:37     ` [PATCH v2 03/10] nfsd: Retry once in nfsd_open on an -EOPENSTALE return trondmy
2021-12-19  1:37       ` [PATCH v2 04/10] nfsd: Distinguish between required and optional NFSv3 post-op attributes trondmy
2021-12-19  1:37         ` [PATCH v2 05/10] nfs: Add export support for weak cache consistency attributes trondmy
2021-12-19  1:37           ` [PATCH v2 06/10] nfsd: NFSv3 should allow zero length writes trondmy
2021-12-19  1:38             ` [PATCH v2 07/10] nfsd: Add a tracepoint for errors in nfsd4_clone_file_range() trondmy
2021-12-19  1:38               ` [PATCH v2 08/10] nfsd: Replace use of rwsem with errseq_t trondmy
2021-12-19  1:38                 ` [PATCH v2 09/10] nfsd: allow lockd to be forcibly disabled trondmy
2021-12-19  1:38                   ` [PATCH v2 10/10] nfsd: Ignore rpcbind errors on nfsd startup trondmy
2021-12-19 18:15                     ` Chuck Lever III
2021-12-19 20:49                       ` Trond Myklebust
2021-12-20 15:51                         ` Chuck Lever III
2021-12-20 18:35                           ` Trond Myklebust
2021-12-20 19:02                             ` Chuck Lever III
2021-12-20 19:52                               ` Trond Myklebust
2021-12-20 20:12                                 ` Chuck Lever III
2021-12-19 18:34                   ` [PATCH v2 09/10] nfsd: allow lockd to be forcibly disabled Chuck Lever III
2021-12-21 18:14               ` [PATCH v2 07/10] nfsd: Add a tracepoint for errors in nfsd4_clone_file_range() Chuck Lever III
2021-12-19 20:11             ` Chuck Lever III [this message]
2022-01-05 16:10           ` [PATCH v2 05/10] nfs: Add export support for weak cache consistency attributes Daire Byrne
2021-12-19 20:10         ` [PATCH v2 04/10] nfsd: Distinguish between required and optional NFSv3 post-op attributes Chuck Lever III
2021-12-19 21:09           ` Trond Myklebust
2021-12-20 16:02             ` Chuck Lever III
2021-12-20 18:38               ` Trond Myklebust
2021-12-20 19:22                 ` Chuck Lever III
2021-12-21 18:10 ` [PATCH v2 00/10] Assorted patches for knfsd Chuck Lever III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26FE2634-B4BC-4E90-AE2D-9B37A2F4D8B2@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.