If a target only supports implicit ALUA sending a SET TARGET PORT GROUPS
command is not only pointless, but might actually cause issues.
So don't.

Signed-off-by: Hannes Reinecke <h...@suse.com>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 4971104b1817..0053277721d0 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -832,6 +832,10 @@ static void alua_rtpg_work(struct work_struct *work)
                if (err != SCSI_DH_OK)
                        pg->flags &= ~ALUA_PG_RUN_STPG;
        }
+       /* Do not run STPG if only implicit ALUA is supported */
+       if (scsi_device_tpgs(sdev) == TPGS_MODE_IMPLICIT)
+               pg->flags &= ~ALUA_PG_RUN_STPG;
+
        if (pg->flags & ALUA_PG_RUN_STPG) {
                pg->flags &= ~ALUA_PG_RUN_STPG;
                spin_unlock_irqrestore(&pg->lock, flags);
-- 
2.16.4

Reply via email to