mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-04-17 08:54:52 +03:00
zil_suspend: fix cookie leak if ZIL crashes during wait
Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17622
This commit is contained in:
parent
7c9adc6858
commit
531568f438
@ -4485,16 +4485,16 @@ zil_suspend(const char *osname, void **cookiep)
|
|||||||
cv_wait(&zilog->zl_cv_suspend, &zilog->zl_lock);
|
cv_wait(&zilog->zl_cv_suspend, &zilog->zl_lock);
|
||||||
mutex_exit(&zilog->zl_lock);
|
mutex_exit(&zilog->zl_lock);
|
||||||
|
|
||||||
if (cookiep == NULL)
|
if (zilog->zl_restart_txg > 0) {
|
||||||
|
/* ZIL crashed while we were waiting. */
|
||||||
|
zil_resume(os);
|
||||||
|
error = SET_ERROR(EBUSY);
|
||||||
|
} else if (cookiep == NULL)
|
||||||
zil_resume(os);
|
zil_resume(os);
|
||||||
else
|
else
|
||||||
*cookiep = os;
|
*cookiep = os;
|
||||||
|
|
||||||
if (zilog->zl_restart_txg > 0)
|
return (error);
|
||||||
/* ZIL crashed while we were waiting. */
|
|
||||||
return (SET_ERROR(EBUSY));
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user