Skip to content
Commit 3885bc68 authored by tarangg@amazon.com's avatar tarangg@amazon.com Committed by Greg Kroah-Hartman
Browse files

NFS: Sync the correct byte range during synchronous writes



commit e973b1a5999e57da677ab50da5f5479fdc0f0c31 upstream.

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: default avatarJacob Strauss <jsstraus@amazon.com>
Signed-off-by: default avatarTarang Gupta <tarangg@amazon.com>
Tested-by: default avatarTarang Gupta <tarangg@amazon.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a70912a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment