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

Commit b9148c6b authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust
Browse files

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: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c216fd70
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -890,6 +890,8 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
	retval = generic_write_checks(file, &pos, &count, 0);
	if (retval)
		goto out;
	if (!count)
		goto out;	/* return 0 */

	retval = -EINVAL;
	if ((ssize_t) count < 0)