summaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2022-03-17 09:09:11 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-03-20 08:59:49 -0700
commit70447e0ad9781f84e60e0990888bd8c84987f44e (patch)
tree00ffcecdce22f83fc0630e1eef994c6630d8645c /fs/ubifs
parent941fbdfd6dd0f1d7961c28123b5460912f678cb5 (diff)
downloadlinux-70447e0ad9781f84e60e0990888bd8c84987f44e.tar.gz
linux-70447e0ad9781f84e60e0990888bd8c84987f44e.tar.bz2
linux-70447e0ad9781f84e60e0990888bd8c84987f44e.zip
xfs: async CIL flushes need pending pushes to be made stable
When the AIL tries to flush the CIL, it relies on the CIL push ending up on stable storage without having to wait for and manipulate iclog state directly. However, if there is already a pending CIL push when the AIL tries to flush the CIL, it won't set the cil->xc_push_commit_stable flag and so the CIL push will not actively flush the commit record iclog. generic/530 when run on a single CPU test VM can trigger this fairly reliably. This test exercises unlinked inode recovery, and can result in inodes being pinned in memory by ongoing modifications to the inode cluster buffer to record unlinked list modifications. As a result, the first inode unlinked in a buffer can pin the tail of the log whilst the inode cluster buffer is pinned by the current checkpoint that has been pushed but isn't on stable storage because because the cil->xc_push_commit_stable was not set. This results in the log/AIL effectively deadlocking until something triggers the commit record iclog to be pushed to stable storage (i.e. the periodic log worker calling xfs_log_force()). The fix is two-fold - first we should always set the cil->xc_push_commit_stable when xlog_cil_flush() is called, regardless of whether there is already a pending push or not. Second, if the CIL is empty, we should trigger an iclog flush to ensure that the iclogs of the last checkpoint have actually been submitted to disk as that checkpoint may not have been run under stable completion constraints. Reported-and-tested-by: Matthew Wilcox <willy@infradead.org> Fixes: 0020a190cf3e ("xfs: AIL needs asynchronous CIL forcing") Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/ubifs')
0 files changed, 0 insertions, 0 deletions