]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: improve the iclog space assert in xlog_write_iovec
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2025 12:14:25 +0000 (13:14 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 21 Jan 2026 11:57:16 +0000 (12:57 +0100)
We need enough space for the length we copy into the iclog, not just
some space, so tighten up the check a bit.

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

index 2c1371f6f5e33977a8e1127ba8ebc364190ea560..6d0319388e29f0ca93dcd31f6e85badee17f991b 100644 (file)
@@ -1891,7 +1891,7 @@ xlog_write_iovec(
        void                    *buf,
        uint32_t                buf_len)
 {
-       ASSERT(xlog_write_space_left(data) > 0);
+       ASSERT(xlog_write_space_left(data) >= buf_len);
        ASSERT(data->log_offset % sizeof(int32_t) == 0);
        ASSERT(buf_len % sizeof(int32_t) == 0);