summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields2018-11-15 17:21:40 +0100
committerJ. Bruce Fields2018-11-27 22:23:12 +0100
commitfdec6114ee1f0f43b1ad081ad8d46b23ba126d70 (patch)
tree36ab65a9e2983ac88d1662fbb207ceeba1a900d5 /fs
parentLinux 4.20-rc4 (diff)
downloadkernel-qcow2-linux-fdec6114ee1f0f43b1ad081ad8d46b23ba126d70.tar.gz
kernel-qcow2-linux-fdec6114ee1f0f43b1ad081ad8d46b23ba126d70.tar.xz
kernel-qcow2-linux-fdec6114ee1f0f43b1ad081ad8d46b23ba126d70.zip
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: 3fd9557aec91 "NFSD: Refactor the generic write vector fill helper" Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4proc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index d505990dac7c..c364acbb6aba 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1016,8 +1016,6 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
nvecs = svc_fill_write_vector(rqstp, write->wr_pagelist,
&write->wr_head, write->wr_buflen);
- if (!nvecs)
- return nfserr_io;
WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec));
status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp,