From 18cc870d46b2aa9df824a5d881b16a423492b3f5 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Thu, 24 Nov 2022 16:51:58 -0500 Subject: [PATCH] LU-14719 lod: ignore space check error in recovery 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 Change-Id: I6c7934ca242a639d996d0ab5a4d7648cec8a53de Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50107 Tested-by: jenkins Tested-by: Maloo --- lustre/lod/lod_dev.c | 6 +++++- lustre/tests/replay-single.sh | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 5126ee8..c05f0e4 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -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; } diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 3a50ff1..c1dbfe0 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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" -- 1.8.3.1