Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use long holds in zvol_set_volsize() #2048

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

Under Linux the zvol_set_volsize() function was originally written
to use dmu_objset_hold()/dmu_objset_rele(). Subsequently, the
dmu_objset_own()/dmu_objset_disown() interfaces were added but
the ZVOL code wasn't updated to take advantage of them.

This was never an issue but after the dsl_pool_config changes
the code now takes the config lock twice. The cleanest solution
is to shift to using dmu_objset_own() which takes a long hold
on the dataset and does not hold the dsl pool lock.

This patch also slightly restructures the existing code such
that it more closely resembles the upstream Illumos code.

Signed-off-by: Brian Behlendorf behlendorf1@llnl.gov
Issue #2039

Under Linux the zvol_set_volsize() function was originally written
to use dmu_objset_hold()/dmu_objset_rele().  Subsequently, the
dmu_objset_own()/dmu_objset_disown() interfaces were added but
the ZVOL code wasn't updated to take advantage of them.

This was never an issue but after the dsl_pool_config changes
the code now takes the config lock twice.  The cleanest solution
is to shift to using dmu_objset_own() which takes a long hold
on the dataset and does not hold the dsl pool lock.

This patch also slightly restructures the existing code such
that it more closely resembles the upstream Illumos code.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#2039
@behlendorf
Copy link
Contributor Author

@nedbass Can you please look this over. It's largely some restructuring to sync up with Illumos and a switch to using long holds to prevent the ASSERT (just like Illumos).

@nedbass
Copy link
Contributor

nedbass commented Jan 14, 2014

Looks good to me.

@behlendorf
Copy link
Contributor Author

Merged as:

35d3e32 Use long holds in zvol_set_volsize()

@behlendorf behlendorf closed this Jan 14, 2014
@clefru
Copy link
Contributor

clefru commented Jan 18, 2014

Sorry for not replying. I wanted to test it before replying but had no time this week. The code LGTM as well.

@clefru
Copy link
Contributor

clefru commented Jan 18, 2014

Tested. Works for me. Thanks for the patch Brian!

@behlendorf
Copy link
Contributor Author

@clefru Wonderful, thanks for the verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants