Skip to contentSkip to conversation

NFS: Ensure we return zero if applications attempt to write zero bytes

PATCH In review Chuck Lever 1 participant 1 message Nov 12, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 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.

---

 fs/nfs/direct.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/direct.c +2 -0
index 88d5d1c..4d726e9 100644
@@ -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)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs