summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-11-21 18:00:00 +0000
committermav <mav@FreeBSD.org>2014-11-21 18:00:00 +0000
commit69cdfe7aaaaaafb5e86602a7bece334a9baabb97 (patch)
tree8794a2774402c3c34ca8f7781fa7925e5c068fc2 /usr.sbin/ctld
parentfbfb63350d2576116205c47bec91e8391627f064 (diff)
downloadFreeBSD-src-69cdfe7aaaaaafb5e86602a7bece334a9baabb97.zip
FreeBSD-src-69cdfe7aaaaaafb5e86602a7bece334a9baabb97.tar.gz
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
Diffstat (limited to 'usr.sbin/ctld')
-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 529131a..ca55063 100644
--- a/usr.sbin/ctld/ctld.c
+++ b/usr.sbin/ctld/ctld.c
@@ -1662,6 +1662,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 "
@@ -1678,16 +1688,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