Whamcloud - gitweb
LU-14719 lod: ignore space check error in recovery
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 24 Nov 2022 21:51:58 +0000 (16:51 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 28 Feb 2023 04:22:51 +0000 (04:22 +0000)
statfs may fail in recovery, ignore this error in
lod_trans_space_check().

Fix syntax error in replay-single 111g version check.

Lustre-change: https://review.whamcloud.com/49249
Lustre-commit: e44489f2f29a2e50883f9bbdec491b65ca92a692

Fixes: 6aee406c84 ("LU-14719 lod: distributed transaction check space")
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I6c7934ca242a639d996d0ab5a4d7648cec8a53de
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50107
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lod/lod_dev.c
lustre/tests/replay-single.sh

index 5126ee8..c05f0e4 100644 (file)
@@ -1699,6 +1699,7 @@ static struct thandle *lod_trans_create(const struct lu_env *env,
  * directories, check space before transaction start.
  */
 static int lod_trans_space_check(const struct lu_env *env,
+                                struct lod_device *lod,
                                 struct thandle *th)
 {
        struct lod_thread_info *info = lod_env_info(env);
@@ -1726,6 +1727,9 @@ static int lod_trans_space_check(const struct lu_env *env,
                if (rc) {
                        CDEBUG(D_INFO, "%s: fail - statfs error: rc = %d\n",
                               sub_dt->dd_lu_dev.ld_obd->obd_name, rc);
+                       /* statfs may fail during recovery, skip check */
+                       if (!lod->lod_recovery_completed)
+                               rc = 0;
                        return rc;
                }
 
@@ -1757,7 +1761,7 @@ static int lod_trans_start(const struct lu_env *env, struct dt_device *dt,
        if (lod->lod_dist_txn_check_space) {
                int rc;
 
-               rc = lod_trans_space_check(env, th);
+               rc = lod_trans_space_check(env, lod, th);
                if (rc)
                        return rc;
        }
index 3a50ff1..c1dbfe0 100755 (executable)
@@ -4181,14 +4181,13 @@ run_test 111f "DNE: unlink striped dir, uncommit on MDT1, fail MDT1/MDT2"
 
 test_111g() {
        (( $MDSCOUNT >= 2 )) || skip "needs >= 2 MDTs"
-       (( $MDS1_VERSION -ge $(version_code 2.7.56) )) ||
+       (( $MDS1_VERSION >= $(version_code 2.7.56) )) ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE != "HARD" ] ||
                [ "$(facet_host mds1)" != "$(facet_host mds2)" ]) ||
                skip "MDTs needs to be on diff hosts for HARD fail mode"
 
-       start_full_debug_logging
        mkdir -p $DIR/$tdir
        $LFS mkdir -i1 -c2 $DIR/$tdir/striped_dir
        $LFS df -i
@@ -4198,7 +4197,6 @@ test_111g() {
        fail mds1,mds2
        $CHECKSTAT -t dir $DIR/$tdir/striped_dir &&
                error "striped dir still exists"
-       stop_full_debug_logging
        return 0
 }
 run_test 111g "DNE: unlink striped dir, fail MDT1/MDT2"