mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-01-16 02:02:04 +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);
|
||||
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);
|
||||
else
|
||||
*cookiep = os;
|
||||
|
||||
if (zilog->zl_restart_txg > 0)
|
||||
/* ZIL crashed while we were waiting. */
|
||||
return (SET_ERROR(EBUSY));
|
||||
|
||||
return (0);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user