staging/lustre/osc: Fix reverted condition in osc_lock_weight
authorOleg Drokin <green@linuxhacker.ru>
Mon, 20 Jun 2016 20:55:29 +0000 (16:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Jun 2016 21:28:39 +0000 (14:28 -0700)
When imprting clio simplification patch, the check for
pbject got reversed by mistake when converting from
if (obj == NULL) it somehow became (if (obj) which is obviously wrong,
and so when it does hit, a crash was happening as result.

Fix the condition and all if fine now.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/osc/osc_lock.c

index d85677522fc908588f783b7cc7c1cfd02ce8f28d..5455d9de045b29896dee81df443518714c2fd960 100644 (file)
@@ -699,7 +699,7 @@ unsigned long osc_ldlm_weigh_ast(struct ldlm_lock *dlmlock)
 
        LASSERT(dlmlock->l_resource->lr_type == LDLM_EXTENT);
        obj = dlmlock->l_ast_data;
-       if (obj) {
+       if (!obj) {
                weight = 1;
                goto out;
        }