]> www.infradead.org Git - users/hch/misc.git/commitdiff
xfs: special case continuation records in xlog_write_region a litte less
authorChristoph Hellwig <hch@lst.de>
Thu, 22 May 2025 18:03:55 +0000 (20:03 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 10 Jun 2025 05:09:55 +0000 (07:09 +0200)
xlog_write_partial already needs to add the size of the op_header  to the
log space reservation requested from xlog_write_get_more_iclog_space.
Adding to the len variable tracking the available reservation instead,
so that xlog_write_region can unconditionally use the reservation.

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

index 223f08a50ca7e0ee6064d13e3d390479b5b3eb48..00b1174d4a30a4596a06f528b3b80f3318ddad1f 100644 (file)
@@ -1912,8 +1912,7 @@ xlog_write_region(
        ASSERT(reg->i_len % sizeof(int32_t) == 0);
 
        *log_offset += sizeof(struct xlog_op_header);
-       if (reg->i_op != XLOG_OP_CONT_TRANS)
-               *bytes_left -= sizeof(struct xlog_op_header);
+       *bytes_left -= sizeof(struct xlog_op_header);
        *data_cnt += sizeof(struct xlog_op_header);
 
        ASSERT(iclog->ic_size - *log_offset > 0);
@@ -2104,10 +2103,9 @@ xlog_write_partial(
                         * consumes hasn't been accounted to the lv we are
                         * writing.
                         */
-                       error = xlog_write_get_more_iclog_space(ticket,
-                                       &iclog, log_offset,
-                                       *len + sizeof(struct xlog_op_header),
-                                       record_cnt, data_cnt);
+                       *len += sizeof(struct xlog_op_header);
+                       error = xlog_write_get_more_iclog_space(ticket, &iclog,
+                                       log_offset, *len, record_cnt, data_cnt);
                        if (error)
                                return error;