Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/iscsi close session when last connection is removed.



details:   https://anonhg.NetBSD.org/src/rev/2ed8580e1337
branches:  trunk
changeset: 345571:2ed8580e1337
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed Jun 01 04:07:03 2016 +0000

description:
close session when last connection is removed.

diffstat:

 sys/dev/iscsi/iscsi_ioctl.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 9845e8390756 -r 2ed8580e1337 sys/dev/iscsi/iscsi_ioctl.c
--- a/sys/dev/iscsi/iscsi_ioctl.c       Wed Jun 01 04:06:15 2016 +0000
+++ b/sys/dev/iscsi/iscsi_ioctl.c       Wed Jun 01 04:07:03 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_ioctl.c,v 1.14 2016/05/29 13:51:16 mlelstv Exp $ */
+/*     $NetBSD: iscsi_ioctl.c,v 1.15 2016/06/01 04:07:03 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1645,7 +1645,10 @@
                        mutex_destroy(&conn->lock);
                        free(conn, M_DEVBUF);
 
-                       --sess->total_connections;
+                       if (--sess->total_connections == 0) {
+                               DEB(1, ("Cleanup: session %d\n", sess->id));
+                               TAILQ_INSERT_HEAD(&iscsi_cleanups_list, sess, sessions);
+                       }
 
                        TAILQ_FOREACH_SAFE(sess, &iscsi_cleanups_list, sessions, nxt) {
                                if (sess->total_connections != 0)



Home | Main Index | Thread Index | Old Index