diff options
author | Hannes Reinecke <hare@suse.de> | 2015-06-11 04:01:27 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-06-23 02:55:27 -0400 |
commit | 3dd348fcaa407181585fcadc04b0cac6e31f9be0 (patch) | |
tree | 35b3f528414cc9986df44aecf70a0d28ebb4d35a /drivers/target | |
parent | 1adff1b3a7f75a1c255b7fcab5676edf29d4a5d8 (diff) |
target: Send UA on ALUA target port group change
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>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_alua.c | 7 | ||||
-rw-r--r-- | drivers/target/target_core_ua.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index c56ae024c42e..744f308053e0 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c | |||
@@ -1880,12 +1880,19 @@ static void core_alua_put_tg_pt_gp_from_name( | |||
1880 | static void __target_attach_tg_pt_gp(struct se_lun *lun, | 1880 | static void __target_attach_tg_pt_gp(struct se_lun *lun, |
1881 | struct t10_alua_tg_pt_gp *tg_pt_gp) | 1881 | struct t10_alua_tg_pt_gp *tg_pt_gp) |
1882 | { | 1882 | { |
1883 | struct se_dev_entry *se_deve; | ||
1884 | |||
1883 | assert_spin_locked(&lun->lun_tg_pt_gp_lock); | 1885 | assert_spin_locked(&lun->lun_tg_pt_gp_lock); |
1884 | 1886 | ||
1885 | spin_lock(&tg_pt_gp->tg_pt_gp_lock); | 1887 | spin_lock(&tg_pt_gp->tg_pt_gp_lock); |
1886 | lun->lun_tg_pt_gp = tg_pt_gp; | 1888 | lun->lun_tg_pt_gp = tg_pt_gp; |
1887 | list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list); | 1889 | list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list); |
1888 | tg_pt_gp->tg_pt_gp_members++; | 1890 | tg_pt_gp->tg_pt_gp_members++; |
1891 | spin_lock(&lun->lun_deve_lock); | ||
1892 | list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link) | ||
1893 | core_scsi3_ua_allocate(se_deve, 0x3f, | ||
1894 | ASCQ_3FH_INQUIRY_DATA_HAS_CHANGED); | ||
1895 | spin_unlock(&lun->lun_deve_lock); | ||
1889 | spin_unlock(&tg_pt_gp->tg_pt_gp_lock); | 1896 | spin_unlock(&tg_pt_gp->tg_pt_gp_lock); |
1890 | } | 1897 | } |
1891 | 1898 | ||
diff --git a/drivers/target/target_core_ua.h b/drivers/target/target_core_ua.h index 96460bff490f..59278d662e66 100644 --- a/drivers/target/target_core_ua.h +++ b/drivers/target/target_core_ua.h | |||
@@ -25,6 +25,8 @@ | |||
25 | 25 | ||
26 | #define ASCQ_2CH_PREVIOUS_RESERVATION_CONFLICT_STATUS 0x09 | 26 | #define ASCQ_2CH_PREVIOUS_RESERVATION_CONFLICT_STATUS 0x09 |
27 | 27 | ||
28 | #define ASCQ_3FH_INQUIRY_DATA_HAS_CHANGED 0x03 | ||
29 | |||
28 | extern struct kmem_cache *se_ua_cache; | 30 | extern struct kmem_cache *se_ua_cache; |
29 | 31 | ||
30 | extern sense_reason_t target_scsi3_ua_check(struct se_cmd *); | 32 | extern sense_reason_t target_scsi3_ua_check(struct se_cmd *); |