X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fldlm%2Fl_lock.c;fp=lustre%2Fldlm%2Fl_lock.c;h=cb08f5b257ab914ab2be0eb6f9c5393af63a395e;hb=553710c16d95250c3a2cec4c0570101508b6cf64;hp=ac268ecd8320067bb765f959778f6691371f8c32;hpb=3863ebcc4388afe09ad96ae74442a46379b450c7;p=fs%2Flustre-release.git diff --git a/lustre/ldlm/l_lock.c b/lustre/ldlm/l_lock.c index ac268ec..cb08f5b 100644 --- a/lustre/ldlm/l_lock.c +++ b/lustre/ldlm/l_lock.c @@ -52,16 +52,15 @@ */ struct ldlm_resource * lock_res_and_lock(struct ldlm_lock *lock) { - struct ldlm_resource *res = lock->l_resource; - - if (ns_is_server(res->lr_namespace)) { - /* on server-side resource of lock doesn't change */ - lock_res(res); - return res; - } + struct ldlm_resource *res = NULL; spin_lock(&lock->l_lock); res = lock->l_resource; + + if (ns_is_server(res->lr_namespace)) + /* on server-side resource of lock doesn't change */ + spin_unlock(&lock->l_lock); + lock_res(res); return res; }