Message ID | 1434009689-112909-5-git-send-email-hare@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> --- 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( > 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_bh(&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_bh(&lun->lun_deve_lock); > spin_unlock(&tg_pt_gp->tg_pt_gp_lock); Taking a _bh lock inside a regular spinlock is completely broken. Fortunately I don't think lun_deve_lock needs to disable bottom halves, but this needs to be fixed first. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
On 06/19/2015 03:05 PM, Christoph Hellwig wrote: >> --- 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( >> 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_bh(&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_bh(&lun->lun_deve_lock); >> spin_unlock(&tg_pt_gp->tg_pt_gp_lock); > > Taking a _bh lock inside a regular spinlock is completely broken. > > Fortunately I don't think lun_deve_lock needs to disable bottom halves, > but this needs to be fixed first. > This harks back to my previous mail: Under which circumstances will there be more than one se_dev_entry structures in lun_deve_list? Isn't there a 1:1 relationship? Cheers, Hannes
On Fri, Jun 19, 2015 at 03:09:34PM +0200, Hannes Reinecke wrote: > This harks back to my previous mail: > Under which circumstances will there be more than one se_dev_entry > structures in lun_deve_list? > Isn't there a 1:1 relationship? No. See my answer to your previous mail. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index aa2e4b1..edaf1b9 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( 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_bh(&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_bh(&lun->lun_deve_lock); spin_unlock(&tg_pt_gp->tg_pt_gp_lock); } diff --git a/drivers/target/target_core_ua.h b/drivers/target/target_core_ua.h index a9c4693..948ae1e 100644 --- a/drivers/target/target_core_ua.h +++ b/drivers/target/target_core_ua.h @@ -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 *);
When the ALUA target port group changes an INQUIRY DATA CHANGE UA needs to be sent. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/target/target_core_alua.c | 7 +++++++ drivers/target/target_core_ua.h | 2 ++ 2 files changed, 9 insertions(+)