Re: [PATCH v3 3/3] scsi: libsas: Fix disk not being scanned in after being removed

From: yangxingui
Date: Thu Mar 07 2024 - 09:17:41 EST



Hi John,
On 2024/3/7 18:08, John Garry wrote:
On 07/03/2024 09:37, Xingui Yang wrote:
As of commit d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to
update PHY info"), do discovery will send a new SMP_DISCOVER and update
phy->phy_change_count. We found that if the disk is reconnected and phy
change_count changes at this time, the disk scanning process will not be
triggered.

Therefore, call sas_set_ex_phy() to update the PHY info with the results of
the last query. And because the previous phy info will be used when calling
sas_unregister_devs_sas_addr(), sas_unregister_devs_sas_addr() should be
called before sas_set_ex_phy().

Fixes: d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to update PHY info")
Signed-off-by: Xingui Yang<yangxingui@xxxxxxxxxx>

I am also ok with a change to revert to allocating the resp memory with alloc_smp_resp(), but make the changes neat please:
Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>
.

Thanks for your review, I have updated the version.

Thanks,
Xingui