svn commit: r274804 - head/usr.sbin/ctld

Alexander Motin mav at FreeBSD.org
Fri Nov 21 18:00:01 UTC 2014


Author: mav
Date: Fri Nov 21 18:00:00 2014
New Revision: 274804
URL: https://svnweb.freebsd.org/changeset/base/274804

Log:
  In conf_apply() remove iSCSI ports from kernel before removing LUNs.
  
  Previous order confused initiators with messages about "removed" LUNs
  during simple ctld restart without any real config change.  After this
  commit initiators only reestablish lost connection, receive "Power on
  occurred" UNIT ATTENTION status and continue normal operation.
  
  MFC after:	1 month

Modified:
  head/usr.sbin/ctld/ctld.c

Modified: head/usr.sbin/ctld/ctld.c
==============================================================================
--- head/usr.sbin/ctld/ctld.c	Fri Nov 21 17:57:37 2014	(r274803)
+++ head/usr.sbin/ctld/ctld.c	Fri Nov 21 18:00:00 2014	(r274804)
@@ -1662,6 +1662,16 @@ conf_apply(struct conf *oldconf, struct 
 		 */
 		newtarg = target_find(newconf, oldtarg->t_name);
 		if (newtarg == NULL) {
+			error = kernel_port_remove(oldtarg);
+			if (error != 0) {
+				log_warnx("failed to remove target %s",
+				    oldtarg->t_name);
+				/*
+				 * XXX: Uncomment after fixing the root cause.
+				 *
+				 * cumulated_error++;
+				 */
+			}
 			TAILQ_FOREACH_SAFE(oldlun, &oldtarg->t_luns, l_next,
 			    tmplun) {
 				log_debugx("target %s not found in new "
@@ -1678,16 +1688,6 @@ conf_apply(struct conf *oldconf, struct 
 					cumulated_error++;
 				}
 			}
-			error = kernel_port_remove(oldtarg);
-			if (error != 0) {
-				log_warnx("failed to remove target %s",
-				    oldtarg->t_name);
-				/*
-				 * XXX: Uncomment after fixing the root cause.
-				 *
-				 * cumulated_error++;
-				 */
-			}
 			continue;
 		}
 


More information about the svn-src-head mailing list