]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/43[4-6]: implement impatient module reloading
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Nov 2024 21:32:50 +0000 (13:32 -0800)
committerZorro Lang <zlang@kernel.org>
Fri, 10 Jan 2025 04:44:03 +0000 (12:44 +0800)
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" <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/module
tests/xfs/434
tests/xfs/435
tests/xfs/436

index a8d5f492d3f4164ec8d12600c5cc124515523a6e..697d76ba718bbcdbdd5007d3d7c819076bcdc6dc 100644 (file)
@@ -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'
+}
index c5122884324eb002a5511494dd8acd6567fb2a4e..fe609b138d732bfcea8ee594e776c5d5d4e9834a 100755 (executable)
@@ -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
index 0bb5675e1dba23277fc5e127afb2c6d2ef00aabc..22c02fbd1289bbfa513ee3a23470d22b083f1cc1 100755 (executable)
@@ -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
index 1f7eb329e1394ea60240f5db2ed7869e3b93ece3..6a9d93d95f432f3aafbe178361b70cbd1a354ad8 100755 (executable)
@@ -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