Whamcloud - gitweb
LU-9183 llite: handle xattr with the xattr_handler infrastructure
[fs/lustre-release.git] / lustre / mgs / mgs_barrier.c
index 13841b1..e661063 100644 (file)
@@ -62,9 +62,11 @@ static int mgs_barrier_gl_interpret_reply(const struct lu_env *env,
        ENTRY;
 
        if (rc) {
-               if (rc == -ENODEV)
+               if (rc == -ENODEV) {
                        /* The lock is useless, cancel it. */
                        ldlm_lock_cancel(ca->ca_lock);
+                       rc = 0;
+               }
 
                GOTO(out, rc);
        }
@@ -718,6 +720,10 @@ int mgs_iocontrol_barrier(const struct lu_env *env,
                     strnlen(bc->bc_name, sizeof(bc->bc_name)) > 8))
                RETURN(-EINVAL);
 
+       /* NOT allow barrier operations during recovery. */
+       if (unlikely(mgs->mgs_obd->obd_recovering))
+               RETURN(-EBUSY);
+
        switch (bc->bc_cmd) {
        case BC_FREEZE:
                rc = mgs_barrier_freeze(env, mgs, bc);