Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 09:12:39 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288749 - stable/10/sys/cam/ctl
Message-ID:  <201510050912.t959CdAM027501@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 09:12:38 2015
New Revision: 288749
URL: https://svnweb.freebsd.org/changeset/base/288749

Log:
  MFC r287758: Reannounce port to HA peer if LUN map changed after online.

Modified:
  stable/10/sys/cam/ctl/ctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl.c	Mon Oct  5 09:11:46 2015	(r288748)
+++ stable/10/sys/cam/ctl/ctl.c	Mon Oct  5 09:12:38 2015	(r288749)
@@ -3155,12 +3155,16 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			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, 
 				retval = ctl_lun_map_init(port);
 		} else
 			return (ENXIO);
+		if (port->status & CTL_PORT_STATUS_ONLINE)
+			ctl_isc_announce_port(port);
 		break;
 	}
 	default: {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510050912.t959CdAM027501>