xfs: avoid unnecessary waits in xfs_log_force_lsn()
authorDave Chinner <dchinner@redhat.com>
Tue, 27 Jul 2021 23:23:49 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 29 Jul 2021 16:27:28 +0000 (09:27 -0700)
commit8191d8222c514c69a8e1ac46bd9812b9e0aab7d0
tree3c973fc94ee8d22389bc5fa3a96b755934d45fc0
parent2bf1ec0ff067ff8f692d261b29c713f3583f7e2a
xfs: avoid unnecessary waits in xfs_log_force_lsn()

Before waiting on a iclog in xfs_log_force_lsn(), we don't check to
see if the iclog has already been completed and the contents on
stable storage. We check for completed iclogs in xfs_log_force(), so
we should do the same thing for xfs_log_force_lsn().

This fixed some random up-to-30s pauses seen in unmounting
filesystems in some tests. A log force ends up waiting on completed
iclog, and that doesn't then get flushed (and hence the log force
get completed) until the background log worker issues a log force
that flushes the iclog in question. Then the unmount unblocks and
continues.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_log.c