linux-stable/fs/xfs
Brian Foster e339dd8d8b xfs: use sync buffer I/O for sync delwri queue submission
If a delwri queue occurs of a buffer that sits on a delwri queue
wait list, the queue sets _XBF_DELWRI_Q without changing the state
of ->b_list. This occurs, for example, if another thread beats the
current delwri waiter thread to the buffer lock after I/O
completion. Once the waiter acquires the lock, it removes the buffer
from the wait list and leaves a buffer with _XBF_DELWRI_Q set but
not populated on a list. This results in a lost buffer submission
and in turn can result in assert failures due to _XBF_DELWRI_Q being
set on buffer reclaim or filesystem lockups if the buffer happens to
cover an item in the AIL.

This problem has been reproduced by repeated iterations of xfs/305
on high CPU count (28xcpu) systems with limited memory (~1GB). Dirty
dquot reclaim races with an xfsaild push of a separate dquot backed
by the same buffer such that the buffer sits on the reclaim wait
list at the time xfsaild attempts to queue it. Since the latter
dquot has been flush locked but the underlying buffer not submitted
for I/O, the dquot pins the AIL and causes the filesystem to
livelock.

This race is essentially made possible by the buffer lock cycle
involved with waiting on a synchronous delwri queue submission.
Close the race by using synchronous buffer I/O for respective delwri
queue submission. This means the buffer remains locked across the
I/O and so is inaccessible from other contexts while in the
intermediate wait list state. The sync buffer I/O wait mechanism is
factored into a helper such that sync delwri buffer submission and
serialization are batched operations.

Designed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2018-07-11 22:26:34 -07:00
..
libxfs xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
scrub xfs: remove unused btree cursor bc_private.a.dfops field 2018-07-11 22:26:17 -07:00
Kconfig xfs: implement the metadata repair ioctl flag 2018-05-15 18:12:50 -07:00
kmem.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
kmem.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
Makefile xfs: move various type verifiers to common file 2018-06-08 10:07:51 -07:00
mrlock.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_acl.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_acl.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_aops.c xfs: update my copyrights for the writeback and iomap code 2018-07-11 22:26:06 -07:00
xfs_aops.h xfs: remove xfs_map_cow 2018-07-11 22:25:59 -07:00
xfs_attr.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_inactive.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_list.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap_item.c xfs: use ->t_dfops for recovery of [b|c]ui log items 2018-07-11 22:26:09 -07:00
xfs_bmap_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap_util.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_bmap_util.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_buf.c xfs: use sync buffer I/O for sync delwri queue submission 2018-07-11 22:26:34 -07:00
xfs_buf.h xfs: add support for sub-pagesize writeback without buffer_heads 2018-07-11 22:26:05 -07:00
xfs_buf_item.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_buf_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dir2_readdir.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_discard.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_discard.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_dquot.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_dquot.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dquot_item.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dquot_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_error.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_error.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_export.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_export.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_extent_busy.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_extent_busy.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_extfree_item.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_extfree_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_file.c Changes since last update: 2018-06-12 15:49:00 -07:00
xfs_filestream.c xfs: remove struct xfs_bmalloca dfops field 2018-07-11 22:26:14 -07:00
xfs_filestream.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_fsmap.c xfs: remove unused btree cursor bc_private.a.dfops field 2018-07-11 22:26:17 -07:00
xfs_fsmap.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_fsops.c xfs: don't trip over negative free space in xfs_reserve_blocks 2018-06-24 11:56:36 -07:00
xfs_fsops.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_globals.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_icache.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_icache.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_icreate_item.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_icreate_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_inode.h xfs: remove dfops parameter from ifree call stack 2018-07-11 22:26:07 -07:00
xfs_inode_item.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ioctl.c Changes since last update: 2018-06-12 15:49:00 -07:00
xfs_ioctl.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ioctl32.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ioctl32.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_iomap.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_iomap.h xfs: replace do_mod with native operations 2018-06-08 10:07:52 -07:00
xfs_iops.c vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
xfs_iops.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_itable.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_itable.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_linux.h xfs: replace do_mod with native operations 2018-06-08 10:07:52 -07:00
xfs_log.c xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_log.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_cil.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_priv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_recover.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_message.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_message.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_mount.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_mount.h xfs: clean up MIN/MAX 2018-06-08 10:07:52 -07:00
xfs_mru_cache.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_mru_cache.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_ondisk.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_pnfs.c xfs: prepare xfs_break_layouts() for another layout type 2018-05-22 07:19:08 -07:00
xfs_pnfs.h xfs: prepare xfs_break_layouts() for another layout type 2018-05-22 07:19:08 -07:00
xfs_qm.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_qm.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_qm_bhv.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_qm_syscalls.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_quota.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_quotaops.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_refcount_item.c xfs: use ->t_dfops for recovery of [b|c]ui log items 2018-07-11 22:26:09 -07:00
xfs_refcount_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_reflink.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_reflink.h xfs: remove xfs_reflink_find_cow_mapping 2018-07-11 22:26:01 -07:00
xfs_rmap_item.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rmap_item.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_rtalloc.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_rtalloc.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_stats.c Changes since last update: 2018-06-12 15:49:00 -07:00
xfs_stats.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_super.c xfs: add support for sub-pagesize writeback without buffer_heads 2018-07-11 22:26:05 -07:00
xfs_super.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_symlink.c xfs: remove xfs_defer_init() firstblock param 2018-07-11 22:26:33 -07:00
xfs_symlink.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_sysctl.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_sysctl.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_sysfs.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_sysfs.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trace.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trace.h xfs: refactor buffer submission into a common helper 2018-07-11 22:26:34 -07:00
xfs_trans.c xfs: add firstblock field to xfs_trans 2018-07-11 22:26:20 -07:00
xfs_trans.h xfs: add firstblock field to xfs_trans 2018-07-11 22:26:20 -07:00
xfs_trans_ail.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_bmap.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_buf.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_dquot.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_extfree.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_inode.c vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
xfs_trans_priv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_refcount.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_rmap.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_xattr.c xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00