NFS: Sync the correct byte range during synchronous writes
Since commit 18290650 ("NFS: Move buffered I/O locking into nfs_file_write()") nfs_file_write() has not flushed the correct byte range during synchronous writes. generic_write_sync() expects that iocb->ki_pos points to the right edge of the range rather than the left edge. To replicate the problem, open a file with O_DSYNC, have the client write at increasing offsets, and then print the successful offsets. Block port 2049 partway through that sequence, and observe that the client application indicates successful writes in advance of what the server received. Fixes: 18290650 ("NFS: Move buffered I/O locking into nfs_file_write()") Signed-off-by: NJacob Strauss <jsstraus@amazon.com> Signed-off-by: NTarang Gupta <tarangg@amazon.com> Tested-by: NTarang Gupta <tarangg@amazon.com> Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
Showing
想要评论请 注册 或 登录