[PATCH v2 0/3] fstests: add patient module remover

From: Luis Chamberlain
Date: Wed Aug 11 2021 - 11:45:26 EST


This is v2 of my series of enhancements to fstests to deal with
false positives with meta block drivers we use for tests such as
scsi_debug which are caused by races by not being able to remove
a driver.

Changes in v2:

- Now that I have confirmed the issue with the refcnt being bumped
after it becomes 0 is also present on linux-next, and *is* a generic
"this is life with modules" matter, I went ahead and implemented
a patient module remover support into kmod and posted patches.
What this means for this series of patches is that we get a real
patient module remover support in modprobe, and so modprobe -p
will soon be an option, if merged. This series then now checks for
that and if its present uses it, otherwise it open codes a similar
solution.

- The patient module remover now also re-tries to remove the module,
as *any* race can easily bump a module refcnt up. We just then need
an upper limit threshold on timeout or to decide if we run forever.

- adds udevadm settle after pvremove

- I confirm now I don't get any stupid module false positives on older
or newer kernels, and life can move on.

Luis Chamberlain (3):
fstests: use udevadm settle after pvremove
common/module: add patient module rmmod support
common/scsi_debug: use the patient module remover

common/config | 31 ++++++++++++++
common/module | 107 ++++++++++++++++++++++++++++++++++++++++++++++
common/scsi_debug | 6 ++-
tests/generic/081 | 5 ++-
tests/generic/108 | 1 +
tests/generic/459 | 1 +
6 files changed, 148 insertions(+), 3 deletions(-)

--
2.30.2