diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 09:12:38 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 09:12:38 +0000 |
commit | 0e819dab72ea40a70f7dbcc2ba79f5dbda97a9e3 (patch) | |
tree | b35dce11d24d587528ef89b5f61ba509902c0faa /sys/cam | |
parent | a0bb28fd76883d01fec2b92729cfde5c334b2ddf (diff) | |
download | FreeBSD-src-0e819dab72ea40a70f7dbcc2ba79f5dbda97a9e3.zip FreeBSD-src-0e819dab72ea40a70f7dbcc2ba79f5dbda97a9e3.tar.gz |
MFC r287758: Reannounce port to HA peer if LUN map changed after online.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/ctl/ctl.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 39597f0..50cfeb2 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -3155,12 +3155,16 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, mtx_unlock(&softc->ctl_lock); return (ENXIO); } - STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) - continue; - mtx_lock(&lun->lun_lock); - ctl_est_ua_port(lun, lm->port, -1, CTL_UA_LUN_CHANGE); - mtx_unlock(&lun->lun_lock); + if (port->status & CTL_PORT_STATUS_ONLINE) { + STAILQ_FOREACH(lun, &softc->lun_list, links) { + if (ctl_lun_map_to_port(port, lun->lun) >= + CTL_MAX_LUNS) + continue; + mtx_lock(&lun->lun_lock); + ctl_est_ua_port(lun, lm->port, -1, + CTL_UA_LUN_CHANGE); + mtx_unlock(&lun->lun_lock); + } } mtx_unlock(&softc->ctl_lock); // XXX: port_enable sleeps if (lm->plun < CTL_MAX_LUNS) { @@ -3178,6 +3182,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, retval = ctl_lun_map_init(port); } else return (ENXIO); + if (port->status & CTL_PORT_STATUS_ONLINE) + ctl_isc_announce_port(port); break; } default: { |