X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fldlm%2Fl_lock.c;h=cb08f5b257ab914ab2be0eb6f9c5393af63a395e;hp=53aa09de8644c0fdc21eb574632f612807e008ff;hb=cf45b9d3ec9aa0872d3654a72f1b5cc9c5fff373;hpb=70e80ade90af09300396706b8910e196a7928520 diff --git a/lustre/ldlm/l_lock.c b/lustre/ldlm/l_lock.c index 53aa09d..cb08f5b 100644 --- a/lustre/ldlm/l_lock.c +++ b/lustre/ldlm/l_lock.c @@ -16,8 +16,8 @@ * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see [sun.com URL with a - * copy of GPLv2]. + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or @@ -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; }