svn commit: r279000 - stable/10/usr.sbin/ctld

Alexander Motin mav at FreeBSD.org
Thu Feb 19 14:26:51 UTC 2015


Author: mav
Date: Thu Feb 19 14:26:49 2015
New Revision: 279000
URL: https://svnweb.freebsd.org/changeset/base/279000

Log:
  MFC r274804:
  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.

Modified:
  stable/10/usr.sbin/ctld/ctld.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/ctld.c
==============================================================================
--- stable/10/usr.sbin/ctld/ctld.c	Thu Feb 19 13:06:38 2015	(r278999)
+++ stable/10/usr.sbin/ctld/ctld.c	Thu Feb 19 14:26:49 2015	(r279000)
@@ -1664,6 +1664,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 "
@@ -1680,16 +1690,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-all mailing list