From: Darrick J. Wong Date: Tue, 26 Nov 2024 21:32:50 +0000 (-0800) Subject: xfs/43[4-6]: implement impatient module reloading X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9163a3fd9fa13e805df35011ce1348573e9b69c2;p=users%2Fhch%2Fxfstests-dev.git xfs/43[4-6]: implement impatient module reloading These three tests try to reload the xfs module as a cheap way to detect leaked inode and dquot objects when the slabs for those object are torn down during rmmod. Removal might not succeed, and we don't really care for that case because we still want to exercise the log recovery code. However, if (say) the root filesystem is xfs, then removal will never succeed. There's no way that waiting 50 seconds(!) per test is going to change that. Add a silly helper to do it fast or go home. Reported-by: sandeen@sandeen.net Signed-off-by: "Darrick J. Wong" Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/module b/common/module index a8d5f492d..697d76ba7 100644 --- a/common/module +++ b/common/module @@ -214,3 +214,14 @@ _patient_rmmod() return $mod_ret } + +# Try to reload a filesystem driver. Don't wait if we can't remove the module, +# and don't let failures related to removing the module escape. The caller +# doesn't care if removal doesn't work. +_optional_reload_fs_module() +{ + MODPROBE_PATIENT_RM_TIMEOUT_SECONDS=0 \ + MODPROBE_REMOVE_PATIENT="" \ + _test_loadable_fs_module "$@" 2>&1 | \ + sed -e '/patient module removal/d' +} diff --git a/tests/xfs/434 b/tests/xfs/434 index c51228843..fe609b138 100755 --- a/tests/xfs/434 +++ b/tests/xfs/434 @@ -74,7 +74,7 @@ _scratch_unmount 2> /dev/null rm -f ${RESULT_DIR}/require_scratch echo "See if we leak" -_test_loadable_fs_module "xfs" +_optional_reload_fs_module "xfs" # success, all done status=0 diff --git a/tests/xfs/435 b/tests/xfs/435 index 0bb5675e1..22c02fbd1 100755 --- a/tests/xfs/435 +++ b/tests/xfs/435 @@ -52,7 +52,7 @@ _scratch_unmount 2> /dev/null rm -f ${RESULT_DIR}/require_scratch echo "See if we leak" -_test_loadable_fs_module "xfs" +_optional_reload_fs_module "xfs" # success, all done status=0 diff --git a/tests/xfs/436 b/tests/xfs/436 index 1f7eb329e..6a9d93d95 100755 --- a/tests/xfs/436 +++ b/tests/xfs/436 @@ -69,7 +69,7 @@ _scratch_unmount 2> /dev/null rm -f ${RESULT_DIR}/require_scratch echo "See if we leak" -_test_loadable_fs_module "xfs" +_optional_reload_fs_module "xfs" # success, all done status=0