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
F111958184: D3281.diff
Mon, Mar 10, 8:04 PM
Unknown Object (File)
Sat, Mar 8, 4:08 AM
Unknown Object (File)
Fri, Mar 7, 3:43 PM
Unknown Object (File)
Wed, Mar 5, 1:54 PM
Unknown Object (File)
Sat, Mar 1, 1:44 PM
Unknown Object (File)
Jan 20 2025, 7:49 AM
Unknown Object (File)
Dec 19 2024, 1:37 PM
Unknown Object (File)
Nov 15 2024, 9:51 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.