diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2016-06-05 09:21:14 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2016-06-05 09:21:14 +0000 |
| commit | cf2933be6d2558ee332b8bd18a6ff14d7e7945b7 (patch) | |
| tree | ff01318fedd39b00ab10a2fd9fc0d9aeea20d20e /sys/dev | |
| parent | 3642acc99d97d5c2a8ad9c0b9139abd32c40d311 (diff) | |
acquire session lock when changing throttling queue
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/iscsi/iscsi_utils.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/iscsi/iscsi_utils.c b/sys/dev/iscsi/iscsi_utils.c index 9e706245fb6..7444159e7a7 100644 --- a/sys/dev/iscsi/iscsi_utils.c +++ b/sys/dev/iscsi/iscsi_utils.c @@ -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 @@ wake_ccb(ccb_t *ccb, uint32_t status) { 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 @@ wake_ccb(ccb_t *ccb, uint32_t status) } 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); |
