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.

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 Linters Available
Unit
No Unit Test Coverage

Event Timeline

avg updated this revision to Diff 7611.Aug 3 2015, 2:18 PM
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.
avg updated this object.Aug 3 2015, 2:20 PM
delphij accepted this revision.Aug 3 2015, 5:25 PM
delphij edited edge metadata.

Looks reasonable to me.

This revision is now accepted and ready to land.Aug 3 2015, 5:25 PM
avg added a reviewer: pjd.Aug 6 2015, 5:21 AM
avg added a comment.Aug 11 2015, 10:03 AM

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.

avg closed this revision.Aug 21 2015, 8:41 AM

Committed in rS286985