Message ID | 20200528163625.110184-1-hare@suse.de (mailing list archive) |
---|---|
Headers | show |
Series | scsi: use xarray for devices and targets | expand |
Hannes, I believe scsi_alloc_target() is broken in the found_target case. For starters starget is created, built and _not_ put in the xarray, hence it is leaked? Seems to me that the code shouldn't go as far as it does before it detects the found_target case. What I'm seeing in testing (script attached) after applying my patches outlined in earlier posts (second attachment) is that LUN 0 is missing on all targets within a host apart from target_id==0 . For example: # modprobe scsi_debug ptype=0x9 no_uld=1 max_luns=2 num_tgts=2 # lsscsi -gs [0:0:0:0] comms Linux scsi_debug 0189 - /dev/sg0 - [0:0:0:1] comms Linux scsi_debug 0189 - /dev/sg1 - [0:0:1:1] comms Linux scsi_debug 0189 - /dev/sg2 - [N:0:1:1] disk INTEL SSDPEKKF256G7L__1 /dev/nvme0n1 - 256GB # sg_luns /dev/sg2 Lun list length = 16 which imples 2 lun entries Report luns [select_report=0x0]: 0000000000000000 0001000000000000 So where did [0:0:1:0] go? The response to REPORT LUNS says it should be there. I thought about jumping into scsi_alloc_target() but it is horribly complicated, so I'll let you deal with it :-) Doug Gilbert