diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 09:06:18 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 09:06:18 +0000 |
commit | de5feb201af3fcecd4c550998c0f109c4c56b9c2 (patch) | |
tree | fd4cdc46c0e4bcf133b80783d5dcc84799fb865d | |
parent | 3b0ffe961dbf54165e0dd07b335dc3f1b4759091 (diff) | |
download | FreeBSD-src-de5feb201af3fcecd4c550998c0f109c4c56b9c2.zip FreeBSD-src-de5feb201af3fcecd4c550998c0f109c4c56b9c2.tar.gz |
MFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node.
-rw-r--r-- | sys/cam/ctl/ctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 2c0f49a..a06aa34 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8406,7 +8406,7 @@ ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg) struct ctl_lun *lun; struct ctl_softc *softc; int i; - uint32_t targ_lun; + uint32_t residx, targ_lun; softc = control_softc; targ_lun = msg->hdr.nexus.targ_mapped_lun; @@ -8422,6 +8422,7 @@ ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg) mtx_unlock(&lun->lun_lock); return; } + residx = ctl_get_initindex(&msg->hdr.nexus); switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: ctl_alloc_prkey(lun, msg->pr.pr_info.residx); @@ -8486,8 +8487,9 @@ ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg) if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = softc->init_min; i < softc->init_max; i++) - if (ctl_get_prkey(lun, i) != 0) - ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); + if (i == residx || ctl_get_prkey(lun, i) == 0) + continue; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } lun->flags &= ~CTL_LUN_PR_RESERVED; |