From 0670d5aed457196121c843fd24877d3f2670d478 Mon Sep 17 00:00:00 2001 From: Alexander Boyko Date: Thu, 21 Feb 2019 10:12:56 -0500 Subject: [PATCH] LU-11975 test: fix for llog test 10h At test 10h thread should set failloc before the test starts adding records. And the main llog_process_thread should wait a bitmap modification. Signed-off-by: Alexander Boyko Change-Id: I4fdedf10f943f6ab264c2d83414f0a404ca42b9c Reviewed-on: https://review.whamcloud.com/34287 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Jian Yu --- lustre/obdclass/llog.c | 14 +++++++------- lustre/obdclass/llog_test.c | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c index e802334..43bf396 100644 --- a/lustre/obdclass/llog.c +++ b/lustre/obdclass/llog.c @@ -554,6 +554,13 @@ repeat: synced_idx == LLOG_HDR_TAIL(llh)->lrt_index) GOTO(out, rc = 0); + if (OBD_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) && + cfs_fail_val == (unsigned int) + (loghandle->lgh_id.lgl_oi.oi.oi_id & + 0xFFFFFFFF)) { + OBD_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT); + } + /* the bitmap could be changed during processing * records from the chunk. For wrapped catalog * it means we can read deleted record and try to @@ -625,13 +632,6 @@ repeat: loghandle->lgh_cur_offset = (char *)rec - (char *)buf + chunk_offset; - if (OBD_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) && - index == lh_last_idx && - cfs_fail_val == (unsigned int) - (loghandle->lgh_id.lgl_oi.oi.oi_id & - 0xFFFFFFFF)) { - OBD_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT); - } /* if set, process the callback on this record */ if (ext2_test_bit(index, LLOG_HDR_BITMAP(llh))) { struct llog_cookie *lgc; diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index 6b2628f..856e8d0 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -1478,6 +1478,7 @@ static int cat_check_old_cb(const struct lu_env *env, struct llog_handle *llh, cfs_fail_loc = OBD_FAIL_ONCE | OBD_FAIL_LLOG_PROCESS_TIMEOUT; cfs_fail_val = (unsigned int) (llh->lgh_id.lgl_oi.oi.oi_id & 0xFFFFFFFF); + msleep(1 * MSEC_PER_SEC); } *prev_fid = fid; @@ -2040,6 +2041,7 @@ static int llog_test_10(const struct lu_env *env, struct obd_device *obd) kthread_run(llog_test_process_thread, &lpi, "llog_test_process_thread"); + msleep(1 * MSEC_PER_SEC / 2); enospc = 0; eok = 0; CWARN("10h: write %d more log records\n", llog_test_recnum); -- 1.8.3.1