diff options
author | Brian Behlendorf <[email protected]> | 2012-06-11 09:12:37 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-06-11 09:17:45 -0700 |
commit | 2371321e8a3d29e19cbc3a280f48636211abb480 (patch) | |
tree | 4d730ed41513f4121f72db1227df06437b378e72 | |
parent | 93b0dc92eab55f8729b4798b383d4670073ebddc (diff) |
Fix invalid context bug
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 zfsonlinux/zfs#771
-rw-r--r-- | module/spl/spl-vnode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index cd0fa2cd1..2e55b007b 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; |