Archive-only list for patches
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: shinichiro.kawasaki@wdc.com
Cc: linux-block@vger.kernel.org, patches@lists.linux.dev,
	gost.dev@samsung.com, sw.prabhu6@gmail.com,
	kernel@pankajraghav.com, bvanassche@acm.org, mcgrof@kernel.org
Subject: [PATCH v4 0/2] blktests: use patient module remover
Date: Wed, 26 Nov 2025 09:11:00 -0800	[thread overview]
Message-ID: <20251126171102.3663957-1-mcgrof@kernel.org> (raw)

This rebases the patient module remover series onto the current blktests
tree and addresses all the feedback from v3 from a long time ago [0]. This
came up recently as Swarna noticed the same flaky bug and I got reminded
to re-send a new iteraiton.

We now have the modprobe --wait upstream so use that if avaiable.

The patient module remover addresses race conditions where module removal
can fail due to userspace temporarily bumping the refcount (e.g., via
blkdev_open() calls). If your version of kmod supports modprobe --wait,
we use that. Otherwise we implement our own patient module remover.

[0] https://lore.kernel.org/all/20221220235324.1445248-2-mcgrof@kernel.org/T/#u

Changes in v4:
  - Rebased onto current blktests master
  - Fixed built-in module handling: _patient_rmmod() now checks for
    the existence of /sys/module/$module_sys/refcnt to detect built-in
    modules and returns success early (Shinichiro Kawasaki)
  - Fixed timeout parameter timing issue: MODPROBE_PATIENT_RM_TIMEOUT_SECONDS
    is now evaluated dynamically inside _patient_rmmod() rather than at
    source time, allowing tests to override the timeout value
    (Shinichiro Kawasaki)
  - Preserved SKIP_REASONS logic in _init_null_blk() when modprobe fails,
    so tests requiring loadable modules are properly skipped rather than
    failing (Shinichiro Kawasaki)
  - Fixed typo in comment: "modprobe -p" -> "modprobe --wait"
    (Luis Chamberlain)
  - Fixed path reference bug: used $module_sys instead of $module for
    /sys/module path checks (Luis Chamberlain)
  - Combined nested while conditions for cleaner code style
    (Shinichiro Kawasaki)
  - Removed redundant $module printing in error messages
    (Shinichiro Kawasaki)
  - Updated to use --wait=TIMEOUT_MSEC syntax (with =) to match the
    upstream kmod implementation


Luis Chamberlain (2):
  blktests: replace module removal with patient module removal
  tests/srp/rc: replace module removal with patient module removal

 common/multipath-over-rdma |  11 +---
 common/null_blk            |   6 +-
 common/nvme                |   9 +--
 common/rc                  | 126 +++++++++++++++++++++++++++++++++++++
 common/scsi_debug          |  14 ++---
 tests/srp/rc               |  19 ++----
 6 files changed, 148 insertions(+), 37 deletions(-)

-- 
2.51.0


             reply	other threads:[~2025-11-26 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 17:11 Luis Chamberlain [this message]
2025-11-26 17:11 ` [PATCH v4 1/2] blktests: replace module removal with patient module removal Luis Chamberlain
2025-11-26 17:44   ` Bart Van Assche
2025-12-19  5:29     ` Shinichiro Kawasaki
2025-12-22 18:11       ` Swarna Prabhu
2025-12-25 12:00         ` Shinichiro Kawasaki
2025-12-18 10:44   ` Shinichiro Kawasaki
2025-12-19  3:06     ` Luis Chamberlain
2025-12-25 12:05   ` Shinichiro Kawasaki
2025-11-26 17:11 ` [PATCH v4 2/2] tests/srp/rc: " Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251126171102.3663957-1-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=gost.dev@samsung.com \
    --cc=kernel@pankajraghav.com \
    --cc=linux-block@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=sw.prabhu6@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox