Whamcloud - gitweb
LU-2558 test: recovery-small 19a FAIL no eviction
[fs/lustre-release.git] / lustre / lov / lov_lock.c
index 2424581..1241f5f 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -1007,6 +1007,11 @@ static int lov_lock_fits_into(const struct lu_env *env,
 
         ENTRY;
 
+       /* for top lock, it's necessary to match enq flags otherwise it will
+        * run into problem if a sublock is missing and reenqueue. */
+       if (need->cld_enq_flags != lov->lls_orig.cld_enq_flags)
+               return 0;
+
         if (need->cld_mode == CLM_GROUP)
                 /*
                  * always allow to match group lock.
@@ -1200,6 +1205,7 @@ static int lov_empty_lock_print(const struct lu_env *env, void *cookie,
        return 0;
 }
 
+/* XXX: more methods will be added later. */
 static const struct cl_lock_operations lov_empty_lock_ops = {
        .clo_fini  = lov_empty_lock_fini,
        .clo_print = lov_empty_lock_print