Summary: | iscsictl disconnects all targets when trying to disconnect one by nickname | ||
---|---|---|---|
Product: | Base System | Reporter: | Benjamin Lutz <mail> |
Component: | bin | Assignee: | Edward Tomasz Napierala <trasz> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | emaste, trasz |
Priority: | --- | Flags: | trasz:
mfc-stable10+
|
Version: | 10.0-STABLE | ||
Hardware: | Any | ||
OS: | Any |
Description
Benjamin Lutz
2014-09-30 09:44:36 UTC
Patch below should fix the bug you've found. Index: sys/dev/iscsi/iscsi.c =================================================================== --- sys/dev/iscsi/iscsi.c (revision 273163) +++ sys/dev/iscsi/iscsi.c (working copy) @@ -1752,18 +1752,16 @@ static bool iscsi_session_conf_matches(unsigned int id1, const struct iscsi_session_conf *c1, unsigned int id2, const struct iscsi_session_conf *c2) { - if (id2 == 0 && c2->isc_target[0] == '\0' && - c2->isc_target_addr[0] == '\0') - return (true); - if (id2 != 0 && id2 == id1) - return (true); + + if (id2 != 0 && id2 != id1) + return (false); if (c2->isc_target[0] != '\0' && - strcmp(c1->isc_target, c2->isc_target) == 0) - return (true); + strcmp(c1->isc_target, c2->isc_target) != 0) + return (false); if (c2->isc_target_addr[0] != '\0' && - strcmp(c1->isc_target_addr, c2->isc_target_addr) == 0) - return (true); - return (false); + strcmp(c1->isc_target_addr, c2->isc_target_addr) != 0) + return (false); + return (true); } static int A commit references this bug: Author: trasz Date: Thu Oct 16 09:09:43 UTC 2014 New revision: 273164 URL: https://svnweb.freebsd.org/changeset/base/273164 Log: When removing an iSCSI session, check whether all conditions match, not if any of them matches. This fixes "iscsictl -Rn" removing unrelated sessions. PR: 194034 MFC after: 1 month Sponsored by: The FreeBSD Foundation Changes: head/sys/dev/iscsi/iscsi.c A commit references this bug: Author: trasz Date: Sat Nov 15 05:50:14 UTC 2014 New revision: 274546 URL: https://svnweb.freebsd.org/changeset/base/274546 Log: MFC r273164: When removing an iSCSI session, check whether all conditions match, not if any of them matches. This fixes "iscsictl -Rn" removing unrelated sessions. PR: 194034 Sponsored by: The FreeBSD Foundation Changes: _U stable/10/ stable/10/sys/dev/iscsi/iscsi.c |