Whamcloud - gitweb
LU-9294 mgs: ignore stale barrier locks 55/26455/6
authorFan Yong <fan.yong@intel.com>
Sat, 3 Dec 2016 00:08:25 +0000 (08:08 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 1 May 2017 17:49:26 +0000 (17:49 +0000)
Currently, when MDT umount/crash, it may not notify the MGS
to cleanup related barrier lock and bitmap. Then subsequent
barrier operation may find some stale barrier locks. It is
unnecessary to return failure by mgs_barrier_glimpse_lock()
for such case, the caller will handle that properly.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I341fd648da2eebbaab729145d1f06c420fce6455
Reviewed-on: https://review.whamcloud.com/26455
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mgs/mgs_barrier.c
lustre/tests/sanity.sh

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);
index 87fe6a8..46dae9c 100755 (executable)
@@ -16114,15 +16114,10 @@ test_409()
 run_test 409 "Large amount of cross-MDTs hard links on the same file"
 
 prep_801() {
-       start_full_debug_logging
-       # cleanup unused barrier locks before test
-
        [[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] ||
        [[ $(lustre_version_code ost1) -lt $(version_code 2.9.55) ]] &&
                skip "Need server version at least 2.9.55" & exit 0
-
-       do_facet mgs $LCTL barrier_rescan $FSNAME ||
-               error "Fail to prep barrier test env"
+       start_full_debug_logging
 }
 
 post_801() {