Module Name: src Committed By: mlelstv Date: Sun Nov 3 10:53:02 UTC 2024
Modified Files: src/sys/dev/iscsi: iscsi_ioctl.c Log Message: Release cleanup mutex before calling kill_connection. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/iscsi/iscsi_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/iscsi/iscsi_ioctl.c diff -u src/sys/dev/iscsi/iscsi_ioctl.c:1.36 src/sys/dev/iscsi/iscsi_ioctl.c:1.37 --- src/sys/dev/iscsi/iscsi_ioctl.c:1.36 Sun Nov 3 10:50:21 2024 +++ src/sys/dev/iscsi/iscsi_ioctl.c Sun Nov 3 10:53:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsi_ioctl.c,v 1.36 2024/11/03 10:50:21 mlelstv Exp $ */ +/* $NetBSD: iscsi_ioctl.c,v 1.37 2024/11/03 10:53:02 mlelstv Exp $ */ /*- * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. @@ -646,19 +646,20 @@ kill_session(uint32_t sid, uint32_t stat } if (recover) { - mutex_exit(&iscsi_cleanup_mtx); - /* * Only recover when there's just one active connection left. * Otherwise we get in all sorts of timing problems, and it doesn't * make much sense anyway to recover when the other side has * requested that we kill a multipathed session. */ - if (sess->s_active_connections == 1) { + conn = NULL; + if (sess->s_active_connections == 1) conn = assign_connection(sess, FALSE); - if (conn != NULL) - kill_connection(conn, status, logout, TRUE); - } + + mutex_exit(&iscsi_cleanup_mtx); + + if (conn != NULL) + kill_connection(conn, status, logout, TRUE); return; }