Skip to content

Commit 538ece1

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 openzfs#17445
1 parent ec52594 commit 538ece1

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
@@ -693,8 +693,11 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
693693
itx->itx_sync = (zp->z_sync_cnt != 0);
694694
itx->itx_gen = gen;
695695

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

700703
off += len;

0 commit comments

Comments
 (0)