<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/scsi/device_handler/scsi_dh_rdac.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-01-30T02:20:53Z</updated>
<entry>
<title>scsi: device_handler: rdac: Have midlayer retry send_mode_select() errors</title>
<updated>2024-01-30T02:20:53Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2024-01-23T00:22:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f316ff46a0ffeada53da7e046bf67b0f3246d4b3'/>
<id>urn:sha1:f316ff46a0ffeada53da7e046bf67b0f3246d4b3</id>
<content type='text'>
This has rdac have the SCSI midlayer retry errors instead of driving them
itself.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/20240123002220.129141-8-michael.christie@oracle.com
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: rdac: Fix sshdr use</title>
<updated>2023-10-13T20:36:20Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2023-10-04T21:00:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=87e145a29363700a3007fb3ae20edd951ad14693'/>
<id>urn:sha1:87e145a29363700a3007fb3ae20edd951ad14693</id>
<content type='text'>
If scsi_execute_cmd returns &lt; 0, it doesn't initialize the sshdr, so we
shouldn't access the sshdr. If it returns 0, then the cmd executed
successfully, so there is no need to check the sshdr. This has us access
the sshdr when we get a return value &gt; 0.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/20231004210013.5601-6-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin Wilck &lt;mwilck@suse.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: rdac: Fix send_mode_select retry handling</title>
<updated>2023-10-13T20:36:19Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2023-10-04T21:00:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2274bd5e3a2cd4c79a34f19f0d29f1478f9ca0e2'/>
<id>urn:sha1:2274bd5e3a2cd4c79a34f19f0d29f1478f9ca0e2</id>
<content type='text'>
If send_mode_select retries scsi_execute_cmd it will leave err set to
SCSI_DH_RETRY/SCSI_DH_IMM_RETRY. If on the retry, the command is
successful, then SCSI_DH_RETRY/SCSI_DH_IMM_RETRY will be returned to the
scsi_dh activation caller. On the retry, we will then detect the previous
MODE SELECT had worked, and so we will return success.

This patch has us return the correct return value, so we can avoid the
extra scsi_dh activation call and to avoid failures if the caller had hit
its activation retry limit and does not end up retrying.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/20231004210013.5601-5-michael.christie@oracle.com
Reviewed-by: Martin Wilck &lt;mwilck@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: scsi_dh: Convert to scsi_execute_cmd()</title>
<updated>2023-01-14T02:34:08Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2022-12-29T19:01:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=31fc28c6b13eedb6da2c60414088c007432436d1'/>
<id>urn:sha1:31fc28c6b13eedb6da2c60414088c007432436d1</id>
<content type='text'>
scsi_execute() is going to be removed. Convert the scsi_dh users to
scsi_execute_cmd().

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi/device_handlers: Use the new blk_opf_t type</title>
<updated>2022-07-14T18:14:32Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2022-07-14T18:07:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c15cbe9a84b05462195102bcead0213eb068c595'/>
<id>urn:sha1:c15cbe9a84b05462195102bcead0213eb068c595</id>
<content type='text'>
Improve static type checking by using the new blk_opf_t type for variables
that represent request flags.

Cc: Hannes Reinecke &lt;hare@suse.com&gt;
Cc: Martin Wilck &lt;mwilck@suse.com&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20220714180729.1065367-43-bvanassche@acm.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>scsi: scsi_dh_rdac: Avoid crash during rdac_bus_attach()</title>
<updated>2021-07-30T01:58:35Z</updated>
<author>
<name>Ye Bin</name>
<email>yebin10@huawei.com</email>
</author>
<published>2021-01-13T06:31:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bc546c0c9abb3bb2fb46866b3d1e6ade9695a5f6'/>
<id>urn:sha1:bc546c0c9abb3bb2fb46866b3d1e6ade9695a5f6</id>
<content type='text'>
The following BUG_ON() was observed during RDAC scan:

[595952.944297] kernel BUG at drivers/scsi/device_handler/scsi_dh_rdac.c:427!
[595952.951143] Internal error: Oops - BUG: 0 [#1] SMP
......
[595953.251065] Call trace:
[595953.259054]  check_ownership+0xb0/0x118
[595953.269794]  rdac_bus_attach+0x1f0/0x4b0
[595953.273787]  scsi_dh_handler_attach+0x3c/0xe8
[595953.278211]  scsi_dh_add_device+0xc4/0xe8
[595953.282291]  scsi_sysfs_add_sdev+0x8c/0x2a8
[595953.286544]  scsi_probe_and_add_lun+0x9fc/0xd00
[595953.291142]  __scsi_scan_target+0x598/0x630
[595953.295395]  scsi_scan_target+0x120/0x130
[595953.299481]  fc_user_scan+0x1a0/0x1c0 [scsi_transport_fc]
[595953.304944]  store_scan+0xb0/0x108
[595953.308420]  dev_attr_store+0x44/0x60
[595953.312160]  sysfs_kf_write+0x58/0x80
[595953.315893]  kernfs_fop_write+0xe8/0x1f0
[595953.319888]  __vfs_write+0x60/0x190
[595953.323448]  vfs_write+0xac/0x1c0
[595953.326836]  ksys_write+0x74/0xf0
[595953.330221]  __arm64_sys_write+0x24/0x30

Code is in check_ownership:

	list_for_each_entry_rcu(tmp, &amp;h-&gt;ctlr-&gt;dh_list, node) {
		/* h-&gt;sdev should always be valid */
		BUG_ON(!tmp-&gt;sdev);
		tmp-&gt;sdev-&gt;access_state = access_state;
	}

	rdac_bus_attach
		initialize_controller
			list_add_rcu(&amp;h-&gt;node, &amp;h-&gt;ctlr-&gt;dh_list);
			h-&gt;sdev = sdev;

	rdac_bus_detach
		list_del_rcu(&amp;h-&gt;node);
		h-&gt;sdev = NULL;

Fix the race between rdac_bus_attach() and rdac_bus_detach() where h-&gt;sdev
is NULL when processing the RDAC attach.

Link: https://lore.kernel.org/r/20210113063103.2698953-1-yebin10@huawei.com
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Ye Bin &lt;yebin10@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: core: Introduce enum scsi_disposition</title>
<updated>2021-04-16T02:44:40Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2021-04-15T22:08:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b8e162f9e7e2da6e823a4984d6aa0523e278babf'/>
<id>urn:sha1:b8e162f9e7e2da6e823a4984d6aa0523e278babf</id>
<content type='text'>
Improve readability of the code in the SCSI core by introducing an
enumeration type for the values used internally that decide how to continue
processing a SCSI command. The eh_*_handler return values have not been
changed because that would involve modifying all SCSI drivers.

The output of the following command has been inspected to verify that no
out-of-range values are assigned to a variable of type enum
scsi_disposition:

KCFLAGS=-Wassign-enum make CC=clang W=1 drivers/scsi/

Link: https://lore.kernel.org/r/20210415220826.29438-6-bvanassche@acm.org
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: scsi_dh_rdac: zero cdb in send_mode_select()</title>
<updated>2019-09-11T01:25:36Z</updated>
<author>
<name>Martin Wilck</name>
<email>Martin.Wilck@suse.com</email>
</author>
<published>2019-09-04T15:52:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=57adf5d4cfd3198aa480e7c94a101fc8c4e6109d'/>
<id>urn:sha1:57adf5d4cfd3198aa480e7c94a101fc8c4e6109d</id>
<content type='text'>
cdb in send_mode_select() is not zeroed and is only partially filled in
rdac_failover_get(), which leads to some random data getting to the
device. Users have reported storage responding to such commands with
INVALID FIELD IN CDB. Code before commit 327825574132 was not affected, as
it called blk_rq_set_block_pc().

Fix this by zeroing out the cdb first.

Identified &amp; fix proposed by HPE.

Fixes: 327825574132 ("scsi_dh_rdac: switch to scsi_execute_req_flags()")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20190904155205.1666-1-martin.wilck@suse.com
Signed-off-by: Martin Wilck &lt;mwilck@suse.com&gt;
Acked-by: Ales Novak &lt;alnovak@suse.cz&gt;
Reviewed-by: Shane Seymour &lt;shane.seymour@hpe.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: return blk_status_t from device handler -&gt;prep_fn</title>
<updated>2018-11-10T02:17:14Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-11-09T13:42:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4c1cb67c03511a4a404aaaeb206222d5bebdc4ca'/>
<id>urn:sha1:4c1cb67c03511a4a404aaaeb206222d5bebdc4ca</id>
<content type='text'>
Remove the last use of the old BLKPREP_* values, which get converted
to BLK_STS_* later anyway.

Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>scsi: device_handler: remove VLAs</title>
<updated>2018-03-13T02:37:20Z</updated>
<author>
<name>Stephen Kitt</name>
<email>steve@sk2.org</email>
</author>
<published>2018-03-09T22:32:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=92eb506262a2a3da9aeaece7017e77490da907dd'/>
<id>urn:sha1:92eb506262a2a3da9aeaece7017e77490da907dd</id>
<content type='text'>
In preparation to enabling -Wvla, remove VLAs and replace them with
fixed-length arrays instead.

scsi_dh_{alua,emc,rdac} use variable-length array declarations to store
command blocks, with the appropriate size as determined by
COMMAND_SIZE. This patch replaces these with fixed-sized arrays using
MAX_COMMAND_SIZE, so that the array size can be determined at compile
time.

This was prompted by https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Stephen Kitt &lt;steve@sk2.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
