aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-11-12 12:16:58 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-11-26 16:32:38 -0500
commitb9148c6b80d802dbc2a7530b29915a80432e50c7 (patch)
tree0388ff65beef42a21d1bd30a4868259f9a3573d2 /fs
parentc216fd708e1a97431925ecffd6d1896cff61df0a (diff)
NFS: Ensure we return zero if applications attempt to write zero bytes
A zero byte count direct write request should be a successful no-op, not an error. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/direct.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 88d5d1c7f987..4d726e9db295 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -890,6 +890,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
890 retval = generic_write_checks(file, &pos, &count, 0); 890 retval = generic_write_checks(file, &pos, &count, 0);
891 if (retval) 891 if (retval)
892 goto out; 892 goto out;
893 if (!count)
894 goto out; /* return 0 */
893 895
894 retval = -EINVAL; 896 retval = -EINVAL;
895 if ((ssize_t) count < 0) 897 if ((ssize_t) count < 0)