kernel_optimize_test/fs/xfs
Brian Foster 2032a8a27b xfs: serialize unaligned dio writes against all other dio writes
XFS applies more strict serialization constraints to unaligned
direct writes to accommodate things like direct I/O layer zeroing,
unwritten extent conversion, etc. Unaligned submissions acquire the
exclusive iolock and wait for in-flight dio to complete to ensure
multiple submissions do not race on the same block and cause data
corruption.

This generally works in the case of an aligned dio followed by an
unaligned dio, but the serialization is lost if I/Os occur in the
opposite order. If an unaligned write is submitted first and
immediately followed by an overlapping, aligned write, the latter
submits without the typical unaligned serialization barriers because
there is no indication of an unaligned dio still in-flight. This can
lead to unpredictable results.

To provide proper unaligned dio serialization, require that such
direct writes are always the only dio allowed in-flight at one time
for a particular inode. We already acquire the exclusive iolock and
drain pending dio before submitting the unaligned dio. Wait once
more after the dio submission to hold the iolock across the I/O and
prevent further submissions until the unaligned I/O completes. This
is heavy handed, but consistent with the current pre-submission
serialization for unaligned direct writes.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2019-03-26 08:37:55 -07:00
..
libxfs xfs: always init bma in xfs_bmapi_write 2019-03-19 08:16:54 -07:00
scrub xfs: fix btree scrub checking with regards to root-in-inode 2019-03-19 08:16:41 -07:00
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
xfs_acl.c
xfs_acl.h
xfs_aops.c for-5.1/block-20190302 2019-03-08 14:12:17 -08:00
xfs_aops.h xfs: remove the io_type field from the writeback context and ioend 2019-02-17 11:55:53 -08:00
xfs_attr_inactive.c
xfs_attr_list.c xfs: don't overflow xattr listent buffer 2019-02-14 09:36:52 -08:00
xfs_bmap_item.c
xfs_bmap_item.h
xfs_bmap_util.c xfs: introduce an always_cow mode 2019-02-21 07:55:07 -08:00
xfs_bmap_util.h
xfs_buf_item.c
xfs_buf_item.h
xfs_buf.c xfs: fix xfs_buf magic number endian checks 2019-02-18 09:38:41 -08:00
xfs_buf.h xfs: fix xfs_buf magic number endian checks 2019-02-18 09:38:41 -08:00
xfs_dir2_readdir.c
xfs_discard.c xfs: prohibit fstrim in norecovery mode 2019-03-25 08:03:29 -07:00
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c
xfs_dquot.h
xfs_error.c xfs: cache unlinked pointers in an rhashtable 2019-02-11 16:07:01 -08:00
xfs_error.h xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask 2019-02-11 16:07:00 -08:00
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c xfs: serialize unaligned dio writes against all other dio writes 2019-03-26 08:37:55 -07:00
xfs_filestream.c
xfs_filestream.h
xfs_fsmap.c
xfs_fsmap.h
xfs_fsops.c xfs: reserve blocks for ifree transaction during log recovery 2019-02-14 22:42:57 -08:00
xfs_fsops.h
xfs_globals.c xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask 2019-02-11 16:07:00 -08:00
xfs_icache.c
xfs_icache.h
xfs_icreate_item.c
xfs_icreate_item.h
xfs_inode_item.c
xfs_inode_item.h
xfs_inode.c xfs: don't ever put nlink > 0 inodes on the unlinked list 2019-02-14 22:42:57 -08:00
xfs_inode.h xfs: cache unlinked pointers in an rhashtable 2019-02-11 16:07:01 -08:00
xfs_ioctl.c
xfs_ioctl.h
xfs_ioctl32.c
xfs_ioctl32.h
xfs_iomap.c xfs: rework breaking of shared extents in xfs_file_iomap_begin 2019-02-25 09:26:18 -08:00
xfs_iomap.h xfs: fix SEEK_DATA for speculative COW fork preallocation 2019-02-21 07:55:07 -08:00
xfs_iops.c xfs: fix reporting supported extra file attributes for statx() 2019-03-01 08:57:25 -08:00
xfs_iops.h
xfs_itable.c
xfs_itable.h
xfs_linux.h
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c xfs: fix xfs_buf magic number endian checks 2019-02-18 09:38:41 -08:00
xfs_log.c
xfs_log.h
xfs_message.c
xfs_message.h
xfs_mount.c xfs: cache unlinked pointers in an rhashtable 2019-02-11 16:07:01 -08:00
xfs_mount.h xfs: introduce an always_cow mode 2019-02-21 07:55:07 -08:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_ondisk.h xfs: compile time offset checks for common v4/v5 metadata 2019-02-11 16:07:01 -08:00
xfs_pnfs.c xfs: make xfs_bmbt_to_iomap more useful 2019-02-21 07:55:07 -08:00
xfs_pnfs.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c
xfs_qm.h
xfs_quota.h
xfs_quotaops.c
xfs_refcount_item.c
xfs_refcount_item.h
xfs_reflink.c xfs: fix uninitialized error variables 2019-02-25 10:16:41 -08:00
xfs_reflink.h xfs: don't pass iomap flags to xfs_reflink_allocate_cow 2019-02-25 09:04:31 -08:00
xfs_rmap_item.c
xfs_rmap_item.h
xfs_rtalloc.c
xfs_rtalloc.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: introduce an always_cow mode 2019-02-21 07:55:07 -08:00
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c
xfs_sysctl.h xfs: introduce an always_cow mode 2019-02-21 07:55:07 -08:00
xfs_sysfs.c xfs: introduce an always_cow mode 2019-02-21 07:55:07 -08:00
xfs_sysfs.h
xfs_trace.c
xfs_trace.h xfs: merge COW handling into xfs_file_iomap_begin_delay 2019-02-21 07:55:07 -08:00
xfs_trans_ail.c
xfs_trans_bmap.c xfs: remove duplicated xfs_defer.h 2019-02-11 16:07:00 -08:00
xfs_trans_buf.c xfs: clarify documentation for the function to reverify buffers 2019-02-11 16:07:01 -08:00
xfs_trans_dquot.c
xfs_trans_extfree.c xfs: remove duplicated xfs_defer.h 2019-02-11 16:07:00 -08:00
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_refcount.c xfs: remove duplicated xfs_defer.h 2019-02-11 16:07:00 -08:00
xfs_trans_rmap.c xfs: remove duplicated xfs_defer.h 2019-02-11 16:07:00 -08:00
xfs_trans.c
xfs_trans.h
xfs_xattr.c xfs: don't overflow xattr listent buffer 2019-02-14 09:36:52 -08:00
xfs.h