summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-02-19 14:26:49 +0000
committermav <mav@FreeBSD.org>2015-02-19 14:26:49 +0000
commit4d95d689f3f509ade3db3443f2ac676eaa25373f (patch)
tree96259cb52f5311589416e100559b68aa43bee277
parent8fc5fb008d592e8eecc814af44e93625cb4cad7c (diff)
downloadFreeBSD-src-4d95d689f3f509ade3db3443f2ac676eaa25373f.zip
FreeBSD-src-4d95d689f3f509ade3db3443f2ac676eaa25373f.tar.gz
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.
-rw-r--r--usr.sbin/ctld/ctld.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c
index ca66d33..aec0ab7 100644
--- a/usr.sbin/ctld/ctld.c
+++ b/usr.sbin/ctld/ctld.c
@@ -1664,6 +1664,16 @@ conf_apply(struct conf *oldconf, struct conf *newconf)
*/
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 conf *newconf)
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;
}
OpenPOWER on IntegriCloud