提交 b9148c6b 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

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: NChuck Lever <cel@netapp.com>
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 c216fd70
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册