diff options
author | mav <mav@FreeBSD.org> | 2014-11-21 18:00:00 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-11-21 18:00:00 +0000 |
commit | 69cdfe7aaaaaafb5e86602a7bece334a9baabb97 (patch) | |
tree | 8794a2774402c3c34ca8f7781fa7925e5c068fc2 /usr.sbin | |
parent | fbfb63350d2576116205c47bec91e8391627f064 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 20 |
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; } |