X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Flu_object.c;h=59b43d74ec51c905b7133ea6e7d0f832780e2d8c;hp=4aa04430eede20f9b12c20917c061972498a2ed9;hb=f123480738a0eba0372053e069089190a5e13bca;hpb=183c01839227991ce32e68dfffe8dda3debf9d47 diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 4aa0443..59b43d7 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1094,7 +1094,10 @@ void lu_context_key_degister(struct lu_context_key *key) ++key_set_version; spin_lock(&lu_keys_guard); key_fini(&lu_shrink_env.le_ctx, key->lct_index); - lu_keys[key->lct_index] = NULL; + if (lu_keys[key->lct_index]) { + lu_keys[key->lct_index] = NULL; + lu_ref_fini(&key->lct_reference); + } spin_unlock(&lu_keys_guard); LASSERTF(atomic_read(&key->lct_used) == 1, "key has instances: %d\n", @@ -1535,6 +1538,10 @@ int lu_global_init(void) CDEBUG(D_CONSOLE, "Lustre LU module (%p).\n", &lu_keys); + result = lu_ref_global_init(); + if (result != 0) + return result; + LU_CONTEXT_KEY_INIT(&lu_global_key); result = lu_context_key_register(&lu_global_key); if (result != 0) @@ -1550,9 +1557,6 @@ int lu_global_init(void) if (result != 0) return result; - result = lu_ref_global_init(); - if (result != 0) - return result; /* * seeks estimation: 3 seeks to read a record from oi, one to read * inode, one for ea. Unfortunately setting this high value results in