staging: lustre: ldlm: reconstruct proper flags on enqueue resend
authorVitaly Fertman <vitaly_fertman@xyratex.com>
Sun, 18 Sep 2016 20:37:26 +0000 (16:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Sep 2016 07:37:46 +0000 (09:37 +0200)
otherwise, waiting lock may get granted as no BLOCKED_GRANTED
flag is returned

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-1944
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5496
Reviewed-on: http://review.whamcloud.com/11644
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
drivers/staging/lustre/lustre/ldlm/ldlm_request.c

index 78a84509fe76890501a3cb829d0f3e6207de5bc8..861f36f039b56f7e52bb5d77833be5171231efa9 100644 (file)
@@ -470,8 +470,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
        if (flags & LDLM_FL_FAILED)
                goto granted;
 
-       if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
-                      LDLM_FL_BLOCK_CONV))) {
+       if (!(flags & LDLM_FL_BLOCKED_MASK)) {
                if (!data)
                        /* mds granted the lock in the reply */
                        goto granted;
index 55b746044b924b286c0386e7c61f34c81c4af1e4..f516106d7f0195ee367f7685d3439b8051fdd728 100644 (file)
@@ -1549,8 +1549,7 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
                 * before we got a chance to actually enqueue it.  We don't
                 * need to do anything else.
                 */
-               *flags &= ~(LDLM_FL_BLOCK_GRANTED |
-                           LDLM_FL_BLOCK_CONV | LDLM_FL_BLOCK_WAIT);
+               *flags &= ~LDLM_FL_BLOCKED_MASK;
                goto out;
        }
 
index f4364f92f34a549fa2d010da8d6684615f5e6a2c..cc835cbdd1074f67aaa76073e9df1015b1b6f0a1 100644 (file)
@@ -177,8 +177,7 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data)
                return 0;
        }
 
-       if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
-                      LDLM_FL_BLOCK_CONV))) {
+       if (!(flags & LDLM_FL_BLOCKED_MASK)) {
                wake_up(&lock->l_waitq);
                return ldlm_completion_tail(lock);
        }
@@ -224,8 +223,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
                goto noreproc;
        }
 
-       if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
-                      LDLM_FL_BLOCK_CONV))) {
+       if (!(flags & LDLM_FL_BLOCKED_MASK)) {
                wake_up(&lock->l_waitq);
                return 0;
        }