]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: regularize iclog space accounting in xlog_write_partial
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2025 12:14:22 +0000 (13:14 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 21 Jan 2026 11:57:16 +0000 (12:57 +0100)
commita82d7aac758161c310345bb5066f344c21ee783b
treea63e2dd96e608e01f9d5a606b6d6f94823828ce2
parent2499d91180142f18fcd472ab52f37655fd787bf7
xfs: regularize iclog space accounting in xlog_write_partial

When xlog_write_partial splits a log region over multiple iclogs, it
has to include the continuation ophder in the length requested for the
new iclog.  Currently is simply adds that to the request, which makes
the accounting of the used space below look slightly different from the
other users of iclog space that decrement it.

To prepare for more code sharing, add the ophdr size to the len variable
that tracks the number of bytes still are left in this xlog_write
operation before the calling xlog_write_get_more_iclog_space, and then
decrement it later when consuming that space.

This changes the value of len when xlog_write_get_more_iclog_space
returns an error, but as nothing looks at len in that case the
difference doesn't matter.

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