From: Xiang Chen <chenxiang66@hisilicon.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID9GQH -------------------------------- Upstream: No We found that there is a chance that disk is recover when we call phy_discover() to update empty PHY info. It will cause some problem that attached_sas_addr and phy_change_count to be update at advance. Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> DTS:DTS2019041908574 Description: NA Team:HISI_SW Feature or Bugfix:Bugfix Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- drivers/scsi/libsas/sas_expander.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index f08da82e699b..f1ec8d5d3573 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -2149,6 +2149,8 @@ static int sas_ex_unregister(struct domain_device *dev, int phy_id, bool last, */ if (res == 0) sas_set_ex_phy(dev, phy_id, disc_resp); + memcpy(phy->attached_sas_addr, sas_addr, SAS_ADDR_SIZE); + phy->phy_change_count = -1; goto out_free_resp; } else if (SAS_ADDR(sas_addr) == SAS_ADDR(phy->attached_sas_addr) && dev_type_flutter(type, phy->attached_dev_type)) { -- 2.46.1