summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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