[PATCH 5/8] scsi: scsi-multipath: Add basic ALUA support

John Garry john.g.garry at oracle.com
Tue Mar 10 08:52:10 PDT 2026


On 10/03/2026 13:23, Hannes Reinecke wrote:
>>       sdev->scsi_mpath_dev->index = ida_alloc(&scsi_mpath_head->ida, 
>> GFP_KERNEL);
>>       if (sdev->scsi_mpath_dev->index < 0) {
>>           ret = sdev->scsi_mpath_dev->index;
>> diff --git a/include/scsi/scsi_multipath.h b/include/scsi/ 
>> scsi_multipath.h
>> index 2011447f482d6..7c7ee2fb7def7 100644
>> --- a/include/scsi/scsi_multipath.h
>> +++ b/include/scsi/scsi_multipath.h
>> @@ -38,6 +38,9 @@ struct scsi_mpath_device {
>>       int            index;
>>       atomic_t        nr_active;
>>       struct scsi_mpath_head    *scsi_mpath_head;
>> +    int            alua_state;
>> +    int            alua_pref;
>> +    int            alua_valid_states;
>>       char            device_id_str[SCSI_MPATH_DEVICE_ID_LEN];
>>   };
> 
> Is there a specific reason why this cannot be in the generic code?

Sure, it's possible....

> After all, if the device reports anything else than ALUA_STATE_OPTIMAL
> or ALUA_STATE_ACTIVE I/O will fail, irrespective of multipath being
> active.
> 
> I would love to see that in the generic SCSI code, independent on this 
> patchset. It would allow us to simplify the device handler code, too,
> as then device handler really would only be required for explicit
> ALUA. (And could be ignored for scsi-multipathing).

Right, so you would like to see alua_port_group management in a core 
ALUA driver as well, right?

If yes, to repeat, it is hard to separate the DH stuff out...but I can 
try. Examples I would need to deal with (and associated handling):

- alua_port_group members like dh_list
- alua_dh_data memebers like init_error
- everything in alua_queue_data

Thanks




More information about the Linux-nvme mailing list