]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: fix a double completion for buffers on in-memory targets
authorChristoph Hellwig <hch@lst.de>
Thu, 26 Dec 2024 11:04:55 +0000 (11:04 +0000)
committerChristoph Hellwig <hch@lst.de>
Sat, 11 Jan 2025 05:21:41 +0000 (06:21 +0100)
commitb43f080da3e6b7aaaa8bd7427fae98541ff05d26
treef5e0fc772fda804e400aeed773a0c14b1405841b
parent4e7dfb45fe08b2b54d7fe2499fab0eeaa42004ad
xfs: fix a double completion for buffers on in-memory targets

__xfs_buf_submit calls xfs_buf_ioend when b_io_remaining hits zero.  For
in-memory buftargs b_io_remaining is never incremented from it's initial
value of 1, so this always happens.  Thus the extra call to xfs_buf_ioend
in _xfs_buf_ioapply causes a double completion.  Fortunately
__xfs_buf_submit is only used for synchronous reads on in-memory buftargs
due to the peculiarities of how they work, so this is mostly harmless and
just causes a little extra work to be done.

Fixes: 5076a6040ca1 ("xfs: support in-memory buffer cache targets")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fs/xfs/xfs_buf.c