diff options
author | Dave Chinner <dchinner@redhat.com> | 2018-11-19 13:31:10 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-11-21 10:10:53 -0800 |
commit | 0929d8580071c6a1cec1a7916a8f674c243ceee1 (patch) | |
tree | 665fe3dd2d8f33b072b2a1d62bd73517a7160b4e /certs | |
parent | 9230a0b65b47fe6856c4468ec0175c4987e5bede (diff) | |
download | linux-0929d8580071c6a1cec1a7916a8f674c243ceee1.tar.bz2 |
iomap: FUA is wrong for DIO O_DSYNC writes into unwritten extents
When we write into an unwritten extent via direct IO, we dirty
metadata on IO completion to convert the unwritten extent to
written. However, when we do the FUA optimisation checks, the inode
may be clean and so we issue a FUA write into the unwritten extent.
This means we then bypass the generic_write_sync() call after
unwritten extent conversion has ben done and we don't force the
modified metadata to stable storage.
This violates O_DSYNC semantics. The window of exposure is a single
IO, as the next DIO write will see the inode has dirty metadata and
hence will not use the FUA optimisation. Calling
generic_write_sync() after completion of the second IO will also
sync the first write and it's metadata.
Fix this by avoiding the FUA optimisation when writing to unwritten
extents.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions