From: Alex Zhuravlev Date: Wed, 4 Dec 2024 07:08:49 +0000 (+0300) Subject: LU-18508 obdclass: llog test to set lpi_rc X-Git-Tag: 2.16.52~80 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=59b78c38318091e75f58ecf937aa176ee16fd523;p=fs%2Flustre-release.git LU-18508 obdclass: llog test to set lpi_rc llog_test_process_thread() should set lpi_rc before signalling own completion, otherwise the caller can find uninitialized lpi_rc. Signed-off-by: Alex Zhuravlev Change-Id: Id49f10bb0454da2bdf047a2c83e4c0462b826018 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57274 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Alexander Boyko Reviewed-by: Andreas Dilger Reviewed-by: Mikhail Pershin --- diff --git a/lustre/kunit/llog_test.c b/lustre/kunit/llog_test.c index a21567b..4fda745 100644 --- a/lustre/kunit/llog_test.c +++ b/lustre/kunit/llog_test.c @@ -1513,9 +1513,9 @@ static int llog_test_process_thread(void *arg) rc = llog_cat_process_or_fork(NULL, lpi->lpi_loghandle, lpi->lpi_cb, NULL, lpi->lpi_cbdata, 1, 0, true); + lpi->lpi_rc = rc; complete(&lpi->lpi_completion); msleep(MSEC_PER_SEC / 2); - lpi->lpi_rc = rc; if (rc) CWARN("10h: Error during catalog processing %d\n", rc); return rc;