Re: [PATCH] scsi: alua: Fix alua_rtpg_queue()

Benjamin Block
2022-11-17T17:58:02Z

On Tue, Nov 15, 2022 at 02:49:03PM -0800, Bart Van Assche wrote:
> Modify alua_rtpg_queue() such that it only requests the caller to drop
> the sdev reference if necessary. This patch fixes a recently introduced
> regression.
>
> Cc: Sachin Sant <sachinp@linux.ibm.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Martin Wilck <mwilck@suse.com>
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Fixes: 0b25e17e9018 ("scsi: alua: Move a scsi_device_put() call out of alua_check_vpd()")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/scsi/device_handler/scsi_dh_alua.c | 31 ++++++++++++++--------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>

Just FYI, we stumbled over this as well in our CI with zFCP as device
driver and the linux-next cut from yesterday `next-20221116` (it started
a couple of days ago).

When I load the module (and all the SCSI devices get sensed/attached) I
get a seemingly endless stream in Inquiry retries:

[ 482.281990] zfcp 0.0.1700: qdio: ZFCP on SC 364 using AI:1 QEBSM:0 PRI:1 TDD:1 SIGA: W
[ 482.308284] scsi host0: scsi_eh_0: sleeping
[ 482.308355] scsi host0: zfcp
[ 482.337627] scsi 0:0:0:16: scsi scan: INQUIRY pass 1 length 36
[ 482.337803] scsi 0:0:0:16: scsi scan: INQUIRY successful with code 0x0
[ 482.337816] scsi 0:0:0:16: scsi scan: INQUIRY pass 2 length 164
[ 482.337987] scsi 0:0:0:16: scsi scan: INQUIRY successful with code 0x0
[ 482.337995] scsi 0:0:0:16: Direct-Access IBM 2107900 2.19 PQ: 0 ANSI: 5
[ 482.339397] scsi 0:0:0:16: alua: supports implicit TPGS
[ 482.339405] scsi 0:0:0:16: alua: device naa.6005076309ffd430000000000000181a port group 0 rel port 1
[ 482.339517] sd 0:0:0:16: sg_alloc: dev=0
[ 482.339566] sd 0:0:0:16: Attached scsi generic sg0 type 0
[ 482.339907] sd 0:0:0:16: Power-on or device reset occurred
[ 482.339923] sd 0:0:0:16: [sda] tag#2560 Done: ADD_TO_MLQUEUE Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[ 482.339930] sd 0:0:0:16: [sda] tag#2560 CDB: Test Unit Ready 00 00 00 00 00 00
[ 482.339936] sd 0:0:0:16: [sda] tag#2560 Sense Key : Unit Attention [current]
[ 482.339942] sd 0:0:0:16: [sda] tag#2560 Add. Sense: Power on, reset, or bus device reset occurred
[ 482.388213] sd 0:0:0:16: [sda] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB)
[ 482.388339] sd 0:0:0:16: [sda] Write Protect is off
[ 482.388341] sd 0:0:0:16: alua: transition timeout set to 60 seconds
[ 482.388342] sd 0:0:0:16: [sda] Mode Sense: ed 00 00 08
[ 482.388346] sd 0:0:0:16: alua: port group 00 state A preferred supports tolusnA
[ 482.388532] sd 0:0:0:16: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 482.388631] sd 0:0:0:16: [sda] tag#2565 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
[ 482.388636] sd 0:0:0:16: [sda] tag#2565 CDB: Report supported operation codes a3 0c 01 12 00 00 00 00 00 0a 00 00
[ 482.388640] sd 0:0:0:16: [sda] tag#2565 Sense Key : Illegal Request [current]
[ 482.388644] sd 0:0:0:16: [sda] tag#2565 Add. Sense: Invalid field in cdb
[ 482.388696] scsi 0:0:1:1073758284: scsi scan: INQUIRY pass 1 length 36
[ 482.388706] scsi 0:0:1:1073758284: tag#576 Done: NEEDS_RETRY Result: hostbyte=DID_IMM_RETRY driverbyte=DRIVER_OK cmd_age=0s
[ 482.388710] scsi 0:0:1:1073758284: tag#576 CDB: Inquiry 12 80 00 00 24 00
[ 482.392545] sd 0:0:0:16: [sda] Attached SCSI disk
[ 482.437995] scsi 0:0:1:1073758284: tag#576 Done: NEEDS_RETRY Result: hostbyte=DID_IMM_RETRY driverbyte=DRIVER_OK cmd_age=0s
[ 482.437998] scsi 0:0:1:1073758284: tag#576 CDB: Inquiry 12 80 00 00 24 00
[ 482.497958] scsi 0:0:1:1073758284: tag#576 Done: NEEDS_RETRY Result: hostbyte=DID_IMM_RETRY driverbyte=DRIVER_OK cmd_age=0s
[ 482.497965] scsi 0:0:1:1073758284: tag#576 CDB: Inquiry 12 80 00 00 24 00
[ 482.537967] scsi 0:0:1:1073758284: tag#576 Done: NEEDS_RETRY Result: hostbyte=DID_IMM_RETRY driverbyte=DRIVER_OK cmd_age=0s
[ 482.537970] scsi 0:0:1:1073758284: tag#576 CDB: Inquiry 12 80 00 00 24 00
[ 482.588004] scsi 0:0:1:1073758284: tag#576 Done: NEEDS_RETRY Result: hostbyte=DID_IMM_RETRY driverbyte=DRIVER_OK cmd_age=0s
[ 482.588008] scsi 0:0:1:1073758284: tag#576 CDB: Inquiry 12 80 00 00 24 00
...

This continues until the command eventually times out. This seems to
have the nock-on effect that systems booted from SCSI volumes hang after
boot.

--
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems
IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy
Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294