Page MenuHomeFreeBSD

try to fix lor between z_teardown_lock and spa_namespace_lock
ClosedPublic

Authored by avg on Aug 3 2015, 2:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 2:51 PM
Unknown Object (File)
Thu, Apr 11, 5:28 AM
Unknown Object (File)
Feb 26 2024, 10:03 PM
Unknown Object (File)
Feb 26 2024, 9:29 PM
Unknown Object (File)
Jan 31 2024, 7:04 AM
Unknown Object (File)
Jan 9 2024, 7:41 PM
Unknown Object (File)
Jan 9 2024, 7:17 PM
Unknown Object (File)
Jan 6 2024, 5:07 AM
Subscribers

Details

Summary

The lock order reversal and a resulting deadlock were introduced
in rS285021 / D2865. The problem is that zfs_register_callbacks() calls
dsl_prop_get_integer() that has to acquire spa_namespace_lock.
At the same time, spa_config_sync() is called with spa_namespace_lock
held and then it performs ZFS vnode operations that acquire
z_teardown_lock in the reader mode.

So, fix the problem by using dsl_prop_get_int_ds() instead of
dsl_prop_get_integer(). The former does not need to look up
the pool and the dataset by name.

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

avg retitled this revision from to try to fix lor between z_teardown_lock and spa_namespace_lock.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: mahrens, delphij.
avg added a subscriber: ZFS.
delphij edited edge metadata.

Looks reasonable to me.

This revision is now accepted and ready to land.Aug 3 2015, 5:25 PM

If any reviewer or subscriber has actually tested the patch please let me know.
Thanks!

In D3281#68259, @avg wrote:

If any reviewer or subscriber has actually tested the patch please let me know.
Thanks!

Sorry for the delay, I run this on my own systems for some time now and it works fine for me. If you want additional tests, please let me know.