mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Remove zl_issuer_lock from zil_suspend().
This locking was recently added as part of #14979. But appears it is illegal to take zl_issuer_lock while holding dp_config_rwlock, taken by dsl_pool_hold(). It causes deadlock with sync thread in spa_sync_upgrades(). On a second thought, we should not need this locking, since zil_commit_impl() we call below takes zl_issuer_lock, that should sufficiently protect zl_suspend reads, combined with other logic from #14979. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15103
This commit is contained in:
parent
41a0f66279
commit
991834f5dc
@ -3941,13 +3941,11 @@ zil_suspend(const char *osname, void **cookiep)
|
|||||||
return (error);
|
return (error);
|
||||||
zilog = dmu_objset_zil(os);
|
zilog = dmu_objset_zil(os);
|
||||||
|
|
||||||
mutex_enter(&zilog->zl_issuer_lock);
|
|
||||||
mutex_enter(&zilog->zl_lock);
|
mutex_enter(&zilog->zl_lock);
|
||||||
zh = zilog->zl_header;
|
zh = zilog->zl_header;
|
||||||
|
|
||||||
if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */
|
if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */
|
||||||
mutex_exit(&zilog->zl_lock);
|
mutex_exit(&zilog->zl_lock);
|
||||||
mutex_exit(&zilog->zl_issuer_lock);
|
|
||||||
dmu_objset_rele(os, suspend_tag);
|
dmu_objset_rele(os, suspend_tag);
|
||||||
return (SET_ERROR(EBUSY));
|
return (SET_ERROR(EBUSY));
|
||||||
}
|
}
|
||||||
@ -3961,7 +3959,6 @@ zil_suspend(const char *osname, void **cookiep)
|
|||||||
if (cookiep == NULL && !zilog->zl_suspending &&
|
if (cookiep == NULL && !zilog->zl_suspending &&
|
||||||
(zilog->zl_suspend > 0 || BP_IS_HOLE(&zh->zh_log))) {
|
(zilog->zl_suspend > 0 || BP_IS_HOLE(&zh->zh_log))) {
|
||||||
mutex_exit(&zilog->zl_lock);
|
mutex_exit(&zilog->zl_lock);
|
||||||
mutex_exit(&zilog->zl_issuer_lock);
|
|
||||||
dmu_objset_rele(os, suspend_tag);
|
dmu_objset_rele(os, suspend_tag);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -3970,7 +3967,6 @@ zil_suspend(const char *osname, void **cookiep)
|
|||||||
dsl_pool_rele(dmu_objset_pool(os), suspend_tag);
|
dsl_pool_rele(dmu_objset_pool(os), suspend_tag);
|
||||||
|
|
||||||
zilog->zl_suspend++;
|
zilog->zl_suspend++;
|
||||||
mutex_exit(&zilog->zl_issuer_lock);
|
|
||||||
|
|
||||||
if (zilog->zl_suspend > 1) {
|
if (zilog->zl_suspend > 1) {
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user