Whamcloud - gitweb
LU-14719 lod: ignore space check error in recovery 49/49249/6
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 24 Nov 2022 21:51:58 +0000 (16:51 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Feb 2023 02:24:02 +0000 (02:24 +0000)
statfs may fail in recovery, ignore this error in
lod_trans_space_check().

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

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

index f6756f0..f0c7075 100644 (file)
@@ -1698,6 +1698,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);
@@ -1725,6 +1726,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;
                }
 
@@ -1756,7 +1760,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 a156b79..ae2f29a 100755 (executable)
@@ -4154,14 +4154,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
@@ -4171,7 +4170,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"