Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/iscsi acquire session lock when changing throttling ...



details:   https://anonhg.NetBSD.org/src/rev/590b44979d58
branches:  trunk
changeset: 815852:590b44979d58
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jun 05 09:21:14 2016 +0000

description:
acquire session lock when changing throttling queue

diffstat:

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

diffs (38 lines):

diff -r 26f26fe30e54 -r 590b44979d58 sys/dev/iscsi/iscsi_utils.c
--- a/sys/dev/iscsi/iscsi_utils.c       Sun Jun 05 09:16:02 2016 +0000
+++ b/sys/dev/iscsi/iscsi_utils.c       Sun Jun 05 09:21:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_utils.c,v 1.17 2016/06/05 09:03:10 mlelstv Exp $ */
+/*     $NetBSD: iscsi_utils.c,v 1.18 2016/06/05 09:21:14 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2004,2005,2006,2008 The NetBSD Foundation, Inc.
@@ -398,8 +398,10 @@
 {
        ccb_disp_t disp;
        connection_t *conn;
+       session_t *sess;
 
        conn = ccb->connection;
+       sess = ccb->session;
 
 #ifdef ISCSI_DEBUG
        DEBC(conn, 9, ("CCB done, ccb = %p, disp = %d\n",
@@ -417,13 +419,16 @@
        }
 
        suspend_ccb(ccb, FALSE);
-       throttle_ccb(ccb, FALSE);
 
        /* change the disposition so nobody tries this again */
        ccb->disp = CCBDISP_BUSY;
        ccb->status = status;
        mutex_exit(&conn->lock);
 
+       mutex_enter(&sess->lock);
+       throttle_ccb(ccb, FALSE);
+       mutex_exit(&sess->lock);
+
        switch (disp) {
        case CCBDISP_FREE:
                free_ccb(ccb);



Home | Main Index | Thread Index | Old Index