linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bvanassche@acm.org>,
	Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH blktests 0/5] improve _have_driver() module load issue solution
Date: Fri,  2 Sep 2022 12:45:11 +0900	[thread overview]
Message-ID: <20220902034516.223173-1-shinichiro.kawasaki@wdc.com> (raw)

The commit 06a0ba866d90 ("common/rc: avoid module load in _have_driver()")
removed module load from _have_driver(). However, it turned out that it was not
a good solution. In the recent discussion for module load preparation for nvme
test cases, it was pointed out no module load in _have_driver() is confusing and
adding complexity [1]:

 - Without module load in _have_driver(), explicit module load and unload are
   required in number of test cases. Boiler plates.
 - The module unload is not always safe. Need care if the module unload is
   expected or not.
 - The module load needs error handling.

I can think of a new helper function to address the comments above, but it will
look like _have_driver() with module load. Hence, I suggest to revert back some
part of the the commit 06a0ba866d90 to load modules in _have_driver() (Sorry
Christoph, Bart for doing this on the commit you reviewed). As a better
solution, I propose to record the modules loaded in _have_driver() and unload
them at each test case end, regardless of the test case is skipped or executed.
I confirmed this fix avoids the issue that the commit 06a0ba866d90 tried to fix.

In this series, 4th patch is the core change in _have_driver. 1st, 2nd and 3rd
patches are clean-up preparation patches for the 4th patch. 5th patch reverts
changes in nbd/rc, which is no longer required after the 4th patch.

[1] https://lore.kernel.org/linux-block/89aedf1d-ae08-adef-db29-17e5bf85d054@grimberg.me/

Shin'ichiro Kawasaki (5):
  check: clean up _run_test()
  common,tests: rename unload_module() to _unload_module()
  check,common/rc: move _unload_module() from common/rc to check
  check,common/rc: load module in _have_driver() and unload after test
  Revert "nbd/rc: load nbd module explicitly"

 check                      | 36 +++++++++++++++++++++++++++++++-----
 common/multipath-over-rdma |  4 ++--
 common/rc                  | 26 ++++++++++----------------
 tests/nbd/rc               | 12 ++----------
 tests/nvmeof-mp/rc         | 12 ++++++------
 tests/srp/rc               |  8 ++++----
 6 files changed, 55 insertions(+), 43 deletions(-)

-- 
2.37.1


             reply	other threads:[~2022-09-02  3:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  3:45 Shin'ichiro Kawasaki [this message]
2022-09-02  3:45 ` [PATCH blktests 1/5] check: clean up _run_test() Shin'ichiro Kawasaki
2022-09-02  3:45 ` [PATCH blktests 2/5] common,tests: rename unload_module() to _unload_module() Shin'ichiro Kawasaki
2022-09-02  3:45 ` [PATCH blktests 3/5] check,common/rc: move _unload_module() from common/rc to check Shin'ichiro Kawasaki
2022-09-02  3:45 ` [PATCH blktests 4/5] check,common/rc: load module in _have_driver() and unload after test Shin'ichiro Kawasaki
2022-09-02  3:45 ` [PATCH blktests 5/5] Revert "nbd/rc: load nbd module explicitly" Shin'ichiro Kawasaki

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=20220902034516.223173-1-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).