summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/iscsi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index 2f5328d..395c8bb 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
sx_sunlock(&sc->sc_lock);
return (EINVAL);
}
+ if (is->is_connected) {
+ /*
+ * This might have happened because another iscsid(8)
+ * instance handed off the connection in the meantime.
+ * Just return.
+ */
+ ISCSI_SESSION_WARN(is, "handoff on already connected "
+ "session");
+ ISCSI_SESSION_UNLOCK(is);
+ sx_sunlock(&sc->sc_lock);
+ return (EBUSY);
+ }
strlcpy(is->is_target_alias, handoff->idh_target_alias,
sizeof(is->is_target_alias));
OpenPOWER on IntegriCloud