Re: [PATCH 1/4] scsi: convert target lookup to xarray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-05-28 00:52, Hannes Reinecke wrote:
> On 5/28/20 9:24 AM, Daniel Wagner wrote:
>> Is there a special reason why don't use xa_for_each to iterate through
>> all
>> entries?
>>
> This entire function is completely daft.
> It says 'scsi_remove_target()', but for some weird reason fails to pass
> in the target it want to delete, so it has to go round in circles trying
> to figure out which target to delete.
> There probably had been an obscure reason for this, but with the current
> code it's just pointless.
> So that's the next thing to fix (after all of this): use a struct
> scsi_target as argument for this function, then this entire loop can go.

Please be careful when modifying this code. I remember that it took
multiple iterations to get this code right. See e.g. commit 81b6c9998979
("scsi: core: check for device state in __scsi_remove_target()"). See
also commit fbce4d97fd43 ("scsi: fixup kernel warning during rmmod()").
See also commit f9279c968c25 ("scsi: Add STARGET_CREATED_REMOVE state to
scsi_target_state").

The only reason I can think of why that loop exists is that @dev may be
associated with multiple targets (struct scsi_target) at the same time.
Is that something that can happen?

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux