Skip to content

Commit aa964ce

Browse files
robnbehlendorf
authored andcommitted
zfs_log_write: only put the callback on the last itx
If a write is split across mutliple itxs, we only want the callback on the last one, otherwise it will be called for every itx associated with this single write, which makes it very hard to know what to clean up. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Mark Johnston <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #17445
1 parent d1c88cb commit aa964ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

module/zfs/zfs_log.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,11 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
694694
itx->itx_sync = (zp->z_sync_cnt != 0);
695695
itx->itx_gen = gen;
696696

697-
itx->itx_callback = callback;
698-
itx->itx_callback_data = callback_data;
697+
if (resid == len) {
698+
itx->itx_callback = callback;
699+
itx->itx_callback_data = callback_data;
700+
}
701+
699702
zil_itx_assign(zilog, itx, tx);
700703

701704
off += len;

0 commit comments

Comments
 (0)