o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper
[cascardo/linux.git] / fs / ocfs2 / dlm / dlmast.c
index b46278f..fd6bbbb 100644 (file)
@@ -385,8 +385,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
                head = &res->granted;
 
        list_for_each_entry(lock, head, list) {
-               if (lock->ml.cookie == cookie)
+               /* if lock is found but unlock is pending ignore the bast */
+               if (lock->ml.cookie == cookie) {
+                       if (lock->unlock_pending)
+                               break;
                        goto do_ast;
+               }
        }
 
        mlog(0, "Got %sast for unknown lock! cookie=%u:%llu, name=%.*s, "