]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: set lv_bytes in xlog_write_one_vec
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2025 12:14:18 +0000 (13:14 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 21 Jan 2026 11:57:16 +0000 (12:57 +0100)
commitc53fbeedbe9098ba2e355fe646f3fe93e57f3f0e
treeea6ba8be97348c3133c0d3346eacb796932e9ed2
parent2d4521e4c00cafcd195f5e6fe5ee75b5c0680b8e
xfs: set lv_bytes in xlog_write_one_vec

lv_bytes is mostly just use by the CIL code, but has crept into the
low-level log writing code to decide on a full or partial iclog
write.  Ensure it is valid even for the special log writes that don't
go through the CIL by initializing it in xlog_write_one_vec.

Note that even without this fix, the checkpoint commits would never
trigger a partial iclog write, as they have no payload beyond the
opheader.

The unmount record on the other hand could in theory trigger a an
overflow of the iclog, but given that is has never been seen in
the wild this has probably been masked by the small size of it
and the fact that the unmount process does multiple log forces
before writing the unmount record and we thus usually operate on
an empty or almost empty iclog.

Fixes: 110dc24ad2ae ("xfs: log vector rounding leaks log space")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_log.c