]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
target: Send UA on ALUA target port group change
authorHannes Reinecke <hare@suse.de>
Thu, 11 Jun 2015 08:01:27 +0000 (10:01 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 23 Jun 2015 06:55:27 +0000 (23:55 -0700)
When the ALUA target port group changes an INQUIRY DATA CHANGE
UA needs to be sent.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_alua.c
drivers/target/target_core_ua.h

index c56ae024c42ece0096896f0fc6e584dc4af231b3..744f308053e07b79c28ce41bf0cbc3ce64dd6b38 100644 (file)
@@ -1880,12 +1880,19 @@ static void core_alua_put_tg_pt_gp_from_name(
 static void __target_attach_tg_pt_gp(struct se_lun *lun,
                struct t10_alua_tg_pt_gp *tg_pt_gp)
 {
+       struct se_dev_entry *se_deve;
+
        assert_spin_locked(&lun->lun_tg_pt_gp_lock);
 
        spin_lock(&tg_pt_gp->tg_pt_gp_lock);
        lun->lun_tg_pt_gp = tg_pt_gp;
        list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list);
        tg_pt_gp->tg_pt_gp_members++;
+       spin_lock(&lun->lun_deve_lock);
+       list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link)
+               core_scsi3_ua_allocate(se_deve, 0x3f,
+                                      ASCQ_3FH_INQUIRY_DATA_HAS_CHANGED);
+       spin_unlock(&lun->lun_deve_lock);
        spin_unlock(&tg_pt_gp->tg_pt_gp_lock);
 }
 
index 96460bff490fca0882d88dd444ca9f3528738ead..59278d662e665fbc11f82c9d8177cc690aed937a 100644 (file)
@@ -25,6 +25,8 @@
 
 #define ASCQ_2CH_PREVIOUS_RESERVATION_CONFLICT_STATUS          0x09
 
+#define ASCQ_3FH_INQUIRY_DATA_HAS_CHANGED                      0x03
+
 extern struct kmem_cache *se_ua_cache;
 
 extern sense_reason_t target_scsi3_ua_check(struct se_cmd *);