Date: Fri, 21 Nov 2014 18:00:00 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274804 - head/usr.sbin/ctld Message-ID: <201411211800.sALI00Ql079862@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Nov 21 18:00:00 2014 New Revision: 274804 URL: https://svnweb.freebsd.org/changeset/base/274804 Log: 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 Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Nov 21 17:57:37 2014 (r274803) +++ head/usr.sbin/ctld/ctld.c Fri Nov 21 18:00:00 2014 (r274804) @@ -1662,6 +1662,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 " @@ -1678,16 +1688,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411211800.sALI00Ql079862>