On 2022-04-22 11:06, Luis Chamberlain wrote:
On Thu, Apr 21, 2022 at 10:56:57PM -0700, Christoph Hellwig wrote:
On Thu, Apr 21, 2022 at 10:53:30AM -0700, Luis Chamberlain wrote:
Moving this discussion to the lists as we need to really think
about how testing on fstests and blktests uses scsi_debug for
a high confidence in baseline without false positives on failures
due to the inability to the remove scsi_debug module.
This should also apply to other test debug modules like null_blk,
nvme target loop drivers, etc, it's all the same long term. But yeah
scsi surely make this... painful today. In any case hopefully folks
with other test debug drivesr are running tests to ensure you can
always rmmod these modules regardless of what is happening.
Maybe fix blktests to not rely on module removal I have such a hard
time actually using blktests because it is suck a f^^Y% broken piece
of crap that assumes everything is modular. Stop making that whole
assumption and work fine with built-in driver as a first step. Then
start worrying about module removal.
It begs the question if the same wish should apply to fstests.
If we want to *not* rely on module removal then the right thing to do I
think would be to replace module removal on these debug modules
(scsi_debug) with an API as null_blk has which uses configfs to *add* /
*remove* devices.
The scsi_debug driver has been around for a while, I started maintaining it
around 1998. It was always assumed that it would be used as a module while
testing, then removed. You might wonder why the number of SCSI hosts simulated
by scsi_debug is called "add_hosts"? That is because it is also a sysfs
read-write parameter that can take a positive or negative integer to add or
remove that number of SCSI hosts at runtime, without removing the module.
See /sys/bus/pseudo/drivers/scsi_debug where about 2/3 of the parameters
are writable. Perhaps configfs capability could be added to scsi_debug,
patches welcome ...
If you want a cheap ram disk to back file system tests then null_blk is the
way to go.
The scsi_debug driver is a SCSI low level driver (LLD) controlling a
simulated HBA (on the "pseudo" bus) that has zero or more SCSI devices
(e.g. disks) attached to it. It is designed to back sd, st, ses Linux
devices (e.g. /dev/sdb). And it can simulate various types of storage
that are found in the real world, for example storage with associated
protection information and more recently with zoned storage. It can also
simulate errors and/or a _lot_ of devices (say 10,000) by sharing the
backing ram behind each device.
So the fact that the scsi_debug driver can support blktests could be seen
as a bit of an accident, that is not its primary purpose.
Doug Gilbert