Skip to content

Commit fdec611

Browse files
author
J. Bruce Fields
committed
nfsd4: zero-length WRITE should succeed
Zero-length writes are legal; from 5661 section 18.32.3: "If the count is zero, the WRITE will succeed and return a count of zero subject to permissions checking". This check is unnecessary and is causing zero-length reads to return EINVAL. Cc: stable@vger.kernel.org Fixes: 3fd9557 "NFSD: Refactor the generic write vector fill helper" Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 2e6e902 commit fdec611

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,6 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
10161016

10171017
nvecs = svc_fill_write_vector(rqstp, write->wr_pagelist,
10181018
&write->wr_head, write->wr_buflen);
1019-
if (!nvecs)
1020-
return nfserr_io;
10211019
WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec));
10221020

10231021
status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp,

0 commit comments

Comments
 (0)