From e44489f2f29a2e50883f9bbdec491b65ca92a692 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. Fixes: 6aee406c84 ("LU-14719 lod: distributed transaction check space") Signed-off-by: Lai Siyao Change-Id: I6c7934ca242a639d996d0ab5a4d7648cec8a53de Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49249 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin 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 f6756f0..f0c7075 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -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; } diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index a156b79..ae2f29a 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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" -- 1.8.3.1