-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
rmmod: "sleeping function called from invalid context" #771
Comments
On first glance that doesn't make sense... the call path referenced shouldn't be an atomic context. It's the generic shutdown path where it's entirely reasonable to sleep. However, looking more closely at it I see what it's rightfully upset about. It looks like we're destroying the kmem_cache under a spin lock which is an atomic context so we do risk a very unlikely deadlock here. Can you try making the following change to the spl to address the issue. diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index cd0fa2c..2e55b00 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -845,13 +845,12 @@ spl_vn_fini(void) leaked++; } - kmem_cache_destroy(vn_file_cache); - vn_file_cache = NULL; spin_unlock(&vn_file_lock); if (leaked > 0) SWARN("Warning %d files leaked\n", leaked); + kmem_cache_destroy(vn_file_cache); kmem_cache_destroy(vn_cache); SEXIT; |
Your patch fixes the issue, thanks. By the way, sorry for posting this issue in the ZFS project, I should have posted it under SPL. |
In the module unload path the vm_file_cache was being destroyed under a spin lock. Because this operation might sleep it was possible, although very very unlikely, that this could result in a deadlock. This issue was indentified by using a Linux debug kernel and has been fixed by moving the kmem_cache_destroy() out from under the spin lock. There is no need to lock this operation here. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs/zfs#771
No problem, I've just merged this simple fix. |
Bumps [config](https://github.com/mehcode/config-rs) from 0.13.2 to 0.13.3. - [Release notes](https://github.com/mehcode/config-rs/releases) - [Changelog](https://github.com/mehcode/config-rs/blob/master/CHANGELOG.md) - [Commits](rust-cli/config-rs@0.13.2...0.13.3) --- updated-dependencies: - dependency-name: config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When rmmod'ing zfs-0.6.0-rc8 on a kernel with debug facilities enabled:
The text was updated successfully, but these errors were encountered: