Revision tags: v5.7.10, v5.4.53, v5.4.52, v5.7.9 |
|
#
30f67481 |
| 12-Jul-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Update documentation url and bump version
This driver maintains a version number which is cross-referenced in the documentation (e.g. to indicate when features are added or changed
scsi: scsi_debug: Update documentation url and bump version
This driver maintains a version number which is cross-referenced in the documentation (e.g. to indicate when features are added or changed) and exposed through the responses to various SCSI commands. For example the version number is use as the Product Revision number in standard SCSI INQUIRY responses issued by this driver. The version date string is placed in a vendor specific area in each standard SCSI INQUIRY response. This patch bumps both.
Update the driver documentation URL that appears at the top of the driver source file.
Link: https://lore.kernel.org/r/20200712182927.72044-3-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
3a90a63d |
| 12-Jul-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: every_nth triggered error injection
This patch simplifies, or at least makes more consistent, the way setting the every_nth parameter injects errors. Here is a list of 'opts' flags
scsi: scsi_debug: every_nth triggered error injection
This patch simplifies, or at least makes more consistent, the way setting the every_nth parameter injects errors. Here is a list of 'opts' flags and in which cases they inject errors when abs(every_nth)%command_count == 0 is reached:
- OPT_RECOVERED_ERR: issued on READ(*)s, WRITE(*)s and WRITE_SCATTEREDs - OPT_DIF_ERR: issued on READ(*)s, WRITE(*)s and WRITE_SCATTEREDs - OPT_DIX_ERR: issued on READ(*)s, WRITE(*)s and WRITE_SCATTEREDs - OPT_SHORT_TRANSFER: issued on READ(*)s - OPT_TRANSPORT_ERR: issued on all commands - OPT_CMD_ABORT: issued on all commands
The other uses of every_nth were not modified.
Previously if, for example, OPT_SHORT_TRANSFER was armed then if (abs(every_nth) % command_count == 0) occurred during a command that was _not_ a READ, then no error injection occurred. This behaviour puzzled several testers. Now a global "inject_pending" flag is set and the _next_ READ will get hit and that flag is cleared. OPT_RECOVERED_ERR, OPT_DIF_ERR and OPT_DIX_ERR have similar behaviour. A downside of this is that there might be a hang-over pending injection that gets triggered by a following test.
Also expand the every_nth runtime parameter so that it can take hex value (i.e. with a leading '0x') as well as a decimal value. Now both the 'opts' and the 'every_nth' runtime parameters can take hexadecimal values.
Link: https://lore.kernel.org/r/20200712182927.72044-2-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
c10fa55f |
| 09-Jul-2020 |
John Garry <john.garry@huawei.com> |
scsi: scsi_debug: Support hostwide tags
Many SCSI HBAs support a hostwide tagset, whereby each command submitted to the HW from all submission queues must have a unique tag identifier.
Normally thi
scsi: scsi_debug: Support hostwide tags
Many SCSI HBAs support a hostwide tagset, whereby each command submitted to the HW from all submission queues must have a unique tag identifier.
Normally this unique tag will be in the range [0, max queue], where "max queue" is the depth of each of the submission queues.
Add support for this hostwide tag feature, via module parameter "host_max_queue". A non-zero value means that the feature is enabled. In this case, the submission queues are not exposed to upper layer, i.e. from blk-mq prespective, the device has a single hw queue. There are 2 reasons for this:
a. It is assumed that the host can support nr_hw_queues * can_queue commands, but this is not true for hostwide tags
b. For nr_hw_queues != 0, the request tag is not unique over all HW queues, and some HBA drivers want to use this tag for the hostwide tag
However, like many SCSI HBA drivers today - megaraid sas being an example - the full set of HW submission queues are still used in the LLDD driver. So instead of using a complicated "reply_map" to create a per-CPU submission queue mapping like megaraid_sas (as it depends on a PCI device + MSIs) - use a simple algorithm:
hwq = cpu % queue count
If the host_max_queue param is set non-zero, then the max queue depth is fixed at this value also.
If and when hostwide shared tags are supported in blk-mq/scsi mid-layer, then the policy to set nr_hw_queues = 0 for hostwide tags can be revised.
Link: https://lore.kernel.org/r/1594297400-24756-3-git-send-email-john.garry@huawei.com Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
c87bf24c |
| 09-Jul-2020 |
John Garry <john.garry@huawei.com> |
scsi: scsi_debug: Add check for sdebug_max_queue during module init
sdebug_max_queue should not exceed SDEBUG_CANQUEUE, otherwise crashes like this can be triggered by passing an out-of-range value:
scsi: scsi_debug: Add check for sdebug_max_queue during module init
sdebug_max_queue should not exceed SDEBUG_CANQUEUE, otherwise crashes like this can be triggered by passing an out-of-range value:
Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0 - V1.16.01 03/15/2019 pstate: 20400009 (nzCv daif +PAN -UAO BTYPE=--) pc : schedule_resp+0x2a4/0xa70 [scsi_debug] lr : schedule_resp+0x52c/0xa70 [scsi_debug] sp : ffff800022ab36f0 x29: ffff800022ab36f0 x28: ffff0023a935a610 x27: ffff800008e0a648 x26: 0000000000000003 x25: ffff0023e84f3200 x24: 00000000003d0900 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0023be60a320 x20: ffff0023be60b538 x19: ffff800008e13000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000001 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 00000000000000c1 x5 : 0000020000200000 x4 : dead0000000000ff x3 : 0000000000000200 x2 : 0000000000000200 x1 : ffff800008e13d88 x0 : 0000000000000000 Call trace: schedule_resp+0x2a4/0xa70 [scsi_debug] scsi_debug_queuecommand+0x2c4/0x9e0 [scsi_debug] scsi_queue_rq+0x698/0x840 __blk_mq_try_issue_directly+0x108/0x228 blk_mq_request_issue_directly+0x58/0x98 blk_mq_try_issue_list_directly+0x5c/0xf0 blk_mq_sched_insert_requests+0x18c/0x200 blk_mq_flush_plug_list+0x11c/0x190 blk_flush_plug_list+0xdc/0x110 blk_finish_plug+0x38/0x210 blkdev_direct_IO+0x450/0x4d8 generic_file_read_iter+0x84/0x180 blkdev_read_iter+0x3c/0x50 aio_read+0xc0/0x170 io_submit_one+0x5c8/0xc98 __arm64_sys_io_submit+0x1b0/0x258 el0_svc_common.constprop.3+0x68/0x170 do_el0_svc+0x24/0x90 el0_sync_handler+0x13c/0x1a8 el0_sync+0x158/0x180 Code: 528847e0 72a001e0 6b00003f 540018cd (3941c340)
In addition, it should not be less than 1.
So add checks for these, and fail the module init for those cases.
[mkp: changed if condition to match error message]
Link: https://lore.kernel.org/r/1594297400-24756-2-git-send-email-john.garry@huawei.com Fixes: c483739430f1 ("scsi_debug: add multiple queue support") Reviewed-by: Ming Lei <ming.lei@redhat.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
Revision tags: v5.7.8, v5.4.51 |
|
#
74595c04 |
| 02-Jul-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Fix in_use bitmap corruption
Heavy testing indicates the irqsave() spinlock around the __set_bit() is insufficient to stop following clear_bit() calls being rarely applied out-of-o
scsi: scsi_debug: Fix in_use bitmap corruption
Heavy testing indicates the irqsave() spinlock around the __set_bit() is insufficient to stop following clear_bit() calls being rarely applied out-of-order. Also the nearby failed kzalloc() path leading to SCSI_MLQUEUE_HOST_BUSY does not properly undo the in_use bitmap and num_in_q, fix.
Link: https://lore.kernel.org/r/20200702145355.522283-1-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
Revision tags: v5.4.50, v5.7.7, v5.4.49, v5.7.6, v5.7.5, v5.4.48, v5.7.4, v5.7.3, v5.4.47, v5.4.46, v5.7.2, v5.4.45, v5.7.1, v5.4.44, v5.7, v5.4.43, v5.4.42, v5.4.41 |
|
#
b6ff8ca7 |
| 12-May-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Parser tables and code interaction
This patch is in response to a static analyser report from Dan Carpenter titled: "[bug report] scsi: scsi_debug: Add per_host_store option". Thi
scsi: scsi_debug: Parser tables and code interaction
This patch is in response to a static analyser report from Dan Carpenter titled: "[bug report] scsi: scsi_debug: Add per_host_store option". This code may not clear the static analyzer reports, but may shed light on why they occur. Amongst other things this driver has a table driven SCSI command parser which also involves some C code. There are some invariants between the table entries and the corresponding C code (i.e. the resp_*() functions) that, if broken, may lead to a NULL dereference. And the report is valid, at least in the case of the PRE-FETCH command. Alas, that is not one of the cases that the static analyzer reported.
In this particular corner case: when the fake_rw flag is set and the table entry for a "store"-accessing command does not have the required F_FAKE_RW flag set, do the following. Call BUG_ON() in the devip2sip() very close to a comment block explaining why it was called and how to fix it. checkpatch.pl complains about the BUG_ON() but there is no reasonable remedial action that can be taken at run time.
This change allows the code reported by the static analyzer to be simplified. Comments were also added to the table flags (e.g. F_FAKE_RW) so developers who add commands might be more inclined to use them (properly).
Link: https://lore.kernel.org/r/20200513013943.25285-1-dgilbert@interlog.com Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
Revision tags: v5.4.40 |
|
#
47742bde |
| 09-May-2020 |
Dan Carpenter <dan.carpenter@oracle.com> |
scsi: scsi_debug: Fix an error handling bug in sdeb_zbc_model_str()
This test is checking the wrong variable. It should be testing "res". The "sdeb_zbc_model" variable is an enum (unsigned in this
scsi: scsi_debug: Fix an error handling bug in sdeb_zbc_model_str()
This test is checking the wrong variable. It should be testing "res". The "sdeb_zbc_model" variable is an enum (unsigned in this situation) and we never assign negative values to it.
[mkp: fixed commit desc issue reported by Doug]
Link: https://lore.kernel.org/r/20200509100408.GA5555@mwanda Fixes: 9267e0eb41fe ("scsi: scsi_debug: Add ZBC module parameter") Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
108e36f0 |
| 06-May-2020 |
Damien Le Moal <damien.lemoal@wdc.com> |
scsi: scsi_debug: Disallow zone sizes that are not powers of 2
Allowing a non-power-of-2 zone size forces the use of direct division operations of 64-bit sector values to obtain a zone number or num
scsi: scsi_debug: Disallow zone sizes that are not powers of 2
Allowing a non-power-of-2 zone size forces the use of direct division operations of 64-bit sector values to obtain a zone number or number of zones. Doing so without using do_div() leads to compilation errors on 32-bit architectures.
Devices with a zone size that is not a power of 2 do not exist today so allowing their emulation is of limited interest as the sd driver will not support them anyway. To fix this compilation error, instead of using do_div() for sector values divisions, simply disallow zone size values that are not a power of 2.
[mkp: commit desc]
Link: https://lore.kernel.org/r/20200507023526.221574-1-damien.lemoal@wdc.com Fixes: 98e0a689868c ("scsi: scsi_debug: Add zone_size_mb module parameter") Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands") Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
Revision tags: v5.4.39, v5.4.38, v5.4.37, v5.4.36, v5.4.35 |
|
#
64e14ece |
| 22-Apr-2020 |
Damien Le Moal <damien.lemoal@wdc.com> |
scsi: scsi_debug: Implement ZBC host-aware emulation
Implement ZBC host-aware device model emulation. The main changes from the host-managed emulation are the device type (TYPE_DISK is used), relaxa
scsi: scsi_debug: Implement ZBC host-aware emulation
Implement ZBC host-aware device model emulation. The main changes from the host-managed emulation are the device type (TYPE_DISK is used), relaxation of access checks for read and write operations and different handling of a sequential write preferred zone write pointer as mandated by the ZBC r05 specifications.
To facilitate the implementation and avoid a lot of "if" statement, the zmodel field is added to the device information and the z_type field to the zone state data structure.
Link: https://lore.kernel.org/r/20200422104221.378203-8-damien.lemoal@wdc.com Tested-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
98e0a689 |
| 22-Apr-2020 |
Damien Le Moal <damien.lemoal@wdc.com> |
scsi: scsi_debug: Add zone_size_mb module parameter
Add the zone_size_mb module parameters to control the zone size of a ZBC device. If the zone size specified is not a divisor of the device capacit
scsi: scsi_debug: Add zone_size_mb module parameter
Add the zone_size_mb module parameters to control the zone size of a ZBC device. If the zone size specified is not a divisor of the device capacity, the last zone of the device will be created as a smaller "runt" zone. This parameter is ignored for device types other than 0x14 (zbc=2 case).
Note: for testing purposes, zone sizes that are not a power of 2 are accepted but will result in the drive being rejected by the sd driver.
Link: https://lore.kernel.org/r/20200422104221.378203-7-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
aa8fecf9 |
| 22-Apr-2020 |
Damien Le Moal <damien.lemoal@wdc.com> |
scsi: scsi_debug: Add zone_nr_conv module parameter
Allow controlling the number of conventional zones of a ZBC device with the new zone_nr_conv module parameter. The default value is 1 and the spec
scsi: scsi_debug: Add zone_nr_conv module parameter
Allow controlling the number of conventional zones of a ZBC device with the new zone_nr_conv module parameter. The default value is 1 and the specified value must be less than the total number of zones of the device. This parameter is ignored for device types other than 0x14 (zbc=2 case).
Link: https://lore.kernel.org/r/20200422104221.378203-6-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
380603a5 |
| 22-Apr-2020 |
Damien Le Moal <damien.lemoal@wdc.com> |
scsi: scsi_debug: Add zone_max_open module parameter
Add the zone_max_open module parameters to control the maximum number of open zones of a ZBC device. This parameter is ignored for device types o
scsi: scsi_debug: Add zone_max_open module parameter
Add the zone_max_open module parameters to control the maximum number of open zones of a ZBC device. This parameter is ignored for device types other than 0x14 (zbc=2 case).
Link: https://lore.kernel.org/r/20200422104221.378203-5-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
9267e0eb |
| 22-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Add ZBC module parameter
Add the zbc module parameter to take either: 0: none (probably a conventional disk) 1: host-aware 2: host-managed
These values are cho
scsi: scsi_debug: Add ZBC module parameter
Add the zbc module parameter to take either: 0: none (probably a conventional disk) 1: host-aware 2: host-managed
These values are chosen to match 'enum blk_zoned_model' found in include/linux/blkdev.h . Instead of "none", "no" or "0" can be given. Instead of "host-aware", "aware or "1" can be given. Instead of "host-managed", "managed" or "2" can be given.
Note: the zbc parameter can only be given at driver/module load time; it cannot be changed via sysfs thereafter.
At this time there is no ZBC "host-aware" implementation so that string (or the value '1') results in a modprobe error.
Link: https://lore.kernel.org/r/20200422104221.378203-4-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
f0d1cf93 |
| 22-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Add ZBC zone commands
Add support for the 5 ZBC commands and enough functionality to emulate a host-managed device with one conventional zone and a set of sequential write-required
scsi: scsi_debug: Add ZBC zone commands
Add support for the 5 ZBC commands and enough functionality to emulate a host-managed device with one conventional zone and a set of sequential write-required zones up to the disk capacity.
Link: https://lore.kernel.org/r/20200422104221.378203-3-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
d36da305 |
| 22-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Add ZBC mode and VPD pages
The ZBC standard "piggy-backs" on many, but not all, of the facilities in SBC. Add those ZBC mode pages (plus mode parameter block descriptors (e.g. "WP"
scsi: scsi_debug: Add ZBC mode and VPD pages
The ZBC standard "piggy-backs" on many, but not all, of the facilities in SBC. Add those ZBC mode pages (plus mode parameter block descriptors (e.g. "WP")) and VPD pages in common with SBC. Add ZBC specific VPD page for the host-managed ZBC device type (ptype=0x14).
Link: https://lore.kernel.org/r/20200422104221.378203-2-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
48e3bf16 |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Bump to version 1.89
The scsi_debug driver version is visible in:
/sys/modules/scsi_debug/version
and can thus be used by user space programs to alter the features they try to
scsi: scsi_debug: Bump to version 1.89
The scsi_debug driver version is visible in:
/sys/modules/scsi_debug/version
and can thus be used by user space programs to alter the features they try to use. Since the per_host_store and zbc/zone options are significant additions, bump the version number to 1.89 .
Link: https://lore.kernel.org/r/20200421151424.32668-9-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
5d807076 |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Re-arrange parameters alphabetically
This module has a lot of parameters and when searching for one, the author prefers them in alphabetical order. This can lead to somewhat illogi
scsi: scsi_debug: Re-arrange parameters alphabetically
This module has a lot of parameters and when searching for one, the author prefers them in alphabetical order. This can lead to somewhat illogical ordering (e.g. inq_product before inq_vendor). However it is not clear what another sensible total logical ordering would be.
Link: https://lore.kernel.org/r/20200421151424.32668-8-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
ed9f3e25 |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Implement PRE-FETCH commands
Many disks implement the SCSI PRE-FETCH commands. One use case might be a disk-to-disk compare, say between disks A and B. Then this sequence of comman
scsi: scsi_debug: Implement PRE-FETCH commands
Many disks implement the SCSI PRE-FETCH commands. One use case might be a disk-to-disk compare, say between disks A and B. Then this sequence of commands might be used: PRE-FETCH(from B, IMMED), READ(from A), VERIFY (BYTCHK=1 on B with data returned from READ). The PRE-FETCH (which returns quickly due to the IMMED) fetches the data from the media into B's cache which should speed the trailing VERIFY command. The next chunk of the compare might be done in parallel, with A and B reversed.
The implementation tries to bring the specified range in main memory into the cache(s) associated with this machine's CPU(s) using the prefetch_range() function.
Link: https://lore.kernel.org/r/20200421151424.32668-7-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
a2aede97 |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Improve command duration calculation
Previously the code did the work implied by the given SCSI command and after that it waited for a timer based on the user specified command dur
scsi: scsi_debug: Improve command duration calculation
Previously the code did the work implied by the given SCSI command and after that it waited for a timer based on the user specified command duration to be exhausted before informing the mid-level that the command was complete. For short command durations, the time to complete the work implied by the SCSI command could be significant compared to the user specified command duration.
For example a WRITE of 128 blocks (say 512 bytes each) on a machine that can copy from main memory to main memory at a rate of 10 GB/sec will take around 6.4 microseconds to do that copy. If the user specified a command duration of 5 microseconds (ndelay=5000), should the driver do a further delay of 5 microseconds after the copy or return immediately because 6.4 > 5 ?
The action prior to this patch was to always do the timer based delay. After this patch, for ndelay values less than 1 millisecond, this driver will complete the command immediately. And in the case where the user specified delay was 7 microseconds, a timer delay of 600 nanoseconds will be set ((7 - 6.4) * 1000).
Link: https://lore.kernel.org/r/20200421151424.32668-6-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
67da413f |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Weaken rwlock around ramdisk access
The design of this driver is to do any ramdisk access on the same thread that invoked the queuecommand() call. That is assumed to be user space
scsi: scsi_debug: Weaken rwlock around ramdisk access
The design of this driver is to do any ramdisk access on the same thread that invoked the queuecommand() call. That is assumed to be user space context. The command duration is implemented by setting the delay with a high resolution timer. The hr timer's callback may well be in interrupt context, but it doesn't touch the ramdisk. So try removing the _irqsave()/_irqrestore() portion on the read-write lock that protects ramdisk access.
Link: https://lore.kernel.org/r/20200421151424.32668-5-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
c3e2fe92 |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Implement VERIFY(10), add VERIFY(16)
With the addition of the per_host_store option, the ability to check whether two different ramdisk images are the same or not becomes practical
scsi: scsi_debug: Implement VERIFY(10), add VERIFY(16)
With the addition of the per_host_store option, the ability to check whether two different ramdisk images are the same or not becomes practical. Prior to this patch VERIFY(10) always returned true (i.e. the SCSI GOOD status) without checking. This option adds support for BYTCHK equal to 0, 1 and 3. If the comparison fails, then a sense key of MISCOMPARE is returned as per the T10 standards. Also add support for the VERIFY(16) command.
Link: https://lore.kernel.org/r/20200421151424.32668-4-dgilbert@interlog.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
87c715dc |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Add per_host_store option
The scsi_debug driver has always been restricted to using one ramdisk image (or none) for its storage. This means that thousands of scsi_debug devices can
scsi: scsi_debug: Add per_host_store option
The scsi_debug driver has always been restricted to using one ramdisk image (or none) for its storage. This means that thousands of scsi_debug devices can be created without exhausting the host machine's RAM. The downside is that all scsi_debug devices share the same ramdisk image. This option changes the way a following write to the add_host parameter (or an add_host in the module/driver invocation) operates. For each new host that is created while per_host_store is true, a new store (of dev-size_mb MiB) is created and associated with all the LUs that belong to that new host. The user (who will need root permissions) needs to take care not to exhaust all the machine's available RAM.
One reason for doing this is to check that (partial) disk to disk copies based on scsi_debug devices have actually copied accurately. To test this the add_host=<n> parameter where <n> is 2 or greater can be used when the scsi_debug module is loaded. Let us assume that /dev/sdb and /dev/sg1 are the same scsi_debug device, while /dev/sdc and /dev/sg2 are the same scsi_debug device. With per_host_store=1 add_host=2 they will have different ramdisk images. Then the following pseudocode could be executed to check if the sgh_dd copy worked:
dd if=/dev/urandom of=/dev/sdb sgh_dd if=/dev/sg1 of=/dev/sg2 [plus option(s) to test] cmp /dev/sdb /dev/sdc
If the cmp fails then the copy has failed (or some other mechanism wrote to /dev/sdb or /dev/sdc in the interim).
[mkp: use kstrtobool()]
Link: https://lore.kernel.org/r/20200421151424.32668-3-dgilbert@interlog.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
#
0c4bc91d |
| 21-Apr-2020 |
Douglas Gilbert <dgilbert@interlog.com> |
scsi: scsi_debug: Randomize command completion time
Add a new command line option (e.g. random=1) and sysfs attribute that causes subsequent command completion times to be between the current comman
scsi: scsi_debug: Randomize command completion time
Add a new command line option (e.g. random=1) and sysfs attribute that causes subsequent command completion times to be between the current command delay setting and 0. A uniformly distributed 32 bit, kernel provided integer is used for this purpose.
Since the existing 'delay' whose units are jiffies (typically milliseconds) and 'ndelay' (units: nanoseconds) options (and sysfs attributes) span a range greater than 32 bits, some scaling is required.
The purpose of this patch is to widen the range of testing cases that are visited in long running tests. Put simply: rarely struct race conditions are more likely to be found when this facility is used.
The default is the previous case in which all command completions were roughly equal to (if not, slightly longer) than the value given by the 'delay' or 'ndelay' settings (or their defaults). This option's default is equivalent to setting 'random=0' .
[mkp: use kstrtobool()]
Link: https://lore.kernel.org/r/20200421151424.32668-2-dgilbert@interlog.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
Revision tags: v5.4.34, v5.4.33, v5.4.32, v5.4.31, v5.4.30, v5.4.29, v5.6, v5.4.28 |
|
#
1442f76d |
| 24-Mar-2020 |
Christoph Hellwig <hch@lst.de> |
block: move struct partition out of genhd.h
struct partition is the on-disk format of a MSDOS partition table entry. Move it out of genhd.h into a new msdos_partition.h header and give it a msdos_ p
block: move struct partition out of genhd.h
struct partition is the on-disk format of a MSDOS partition table entry. Move it out of genhd.h into a new msdos_partition.h header and give it a msdos_ prefix to avoid confusion. Also move the magic number from block/partitions/msdos.h to the new header so that it can be used by the SCSI drivers looking at the DOS partition tables.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
Revision tags: v5.4.27, v5.4.26, v5.4.25, v5.4.24, v5.4.23, v5.4.22, v5.4.21, v5.4.20, v5.4.19, v5.4.18, v5.4.17, v5.4.16, v5.5, v5.4.15, v5.4.14, v5.4.13, v5.4.12, v5.4.11, v5.4.10, v5.4.9, v5.4.8, v5.4.7, v5.4.6, v5.4.5, v5.4.4, v5.4.3, v5.3.15, v5.4.2, v5.4.1, v5.3.14, v5.4, v5.3.13, v5.3.12 |
|
#
aa5334c4 |
| 15-Nov-2019 |
Maurizio Lombardi <mlombard@redhat.com> |
scsi: scsi_debug: num_tgts must be >= 0
Passing the parameter "num_tgts=-1" will start an infinite loop that exhausts the system memory
Link: https://lore.kernel.org/r/20191115163727.24626-1-mlomba
scsi: scsi_debug: num_tgts must be >= 0
Passing the parameter "num_tgts=-1" will start an infinite loop that exhausts the system memory
Link: https://lore.kernel.org/r/20191115163727.24626-1-mlombard@redhat.com Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|