Whamcloud - gitweb
LU-3789 mgs: Add deprecation warning for "lctl conf_param"
[fs/lustre-release.git] / lustre / lclient / lcommon_misc.c
index 9a40ac0..9dd8918 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/
@@ -140,11 +140,13 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
         io->ci_obj = obj;
        io->ci_ignore_layout = 1;
 
-        rc = cl_io_init(env, io, CIT_MISC, io->ci_obj);
-        if (rc) {
-                LASSERT(rc < 0);
-                cl_env_put(env, &refcheck);
-                return rc;
+       rc = cl_io_init(env, io, CIT_MISC, io->ci_obj);
+       if (rc) {
+               /* Does not make sense to take GL for released layout */
+               if (rc > 0)
+                       rc = -ENOTSUPP;
+               cl_env_put(env, &refcheck);
+               return rc;
         }
 
         descr = &ccc_env_info(env)->cti_descr;