]> git.hungrycats.org Git - linux/commit
xfs: also flush the RT device cache in xlog_write_iclog
authorChristoph Hellwig <hch@lst.de>
Mon, 7 Sep 2026 07:33:07 +0000 (10:33 +0300)
committerCarlos Maiolino <cem@kernel.org>
Thu, 10 Sep 2026 14:26:37 +0000 (16:26 +0200)
commitad0033e2dbd3ecc063dfe613060da5cbab9a4970
tree426d0c4f4341c9e6eed004b05221731d0ff9570a
parenteaf580538eb1be3d162400d04c4b7dc4c627296b
xfs: also flush the RT device cache in xlog_write_iclog

The cache flush before writing the CIL start record no only needs to
ensure any metadata covered by the overwritten part of the log is on
stable storage, but also that any data pointed to by metadata logged
is on stable storage, as otherwise log recovery could created allocated
blocks that point to stale data.  Fortunately the code already
handles this right for the data device, but it also needs to flush
the RT device for this to work for data on the RT device.

Also update the comments to explicitly mention this case.

This omission goes back to the first days of cache control in XFS.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_log.c
fs/xfs/xfs_log_cil.c