]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: set lv_bytes in xlog_write_one_vec
authorChristoph Hellwig <hch@lst.de>
Thu, 22 May 2025 03:30:37 +0000 (05:30 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 23 May 2025 03:28:43 +0000 (05:28 +0200)
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_log.c

index 7323ed268c7d3c0564f41ead960c9e65a93ed19c..efcf8b4c95f1deb4e904c42e72a94edee2e598d6 100644 (file)
@@ -802,14 +802,15 @@ xlog_write_one_vec(
        struct xfs_log_vec      lv = {
                .lv_niovecs     = 1,
                .lv_iovecp      = reg,
+               .lv_bytes       = reg->i_len,
        };
        LIST_HEAD               (lv_chain);
 
        /* account for space used by record data */
-       ticket->t_curr_res -= reg->i_len;
+       ticket->t_curr_res -= lv.lv_bytes;
 
        list_add(&lv.lv_list, &lv_chain);
-       return xlog_write(log, ctx, &lv_chain, ticket, reg->i_len);
+       return xlog_write(log, ctx, &lv_chain, ticket, lv.lv_bytes);
 }
 
 /*