提交 c49edecd 编写于 作者: T Trond Myklebust

NFS: Fix error reporting in nfs_file_write()

When doing O_DSYNC writes, the actual write errors are reported through
generic_write_sync(), so we must test the result.
Reported-by: NJ. R. Okajima <hooanon05g@gmail.com>
Fixes: 18290650 ("NFS: Move buffered I/O locking into nfs_file_write()")
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 a41bd25a
......@@ -657,7 +657,10 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
if (result <= 0)
goto out;
written = generic_write_sync(iocb, result);
result = generic_write_sync(iocb, result);
if (result < 0)
goto out;
written = result;
iocb->ki_pos += written;
/* Return error values */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册