Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/iscsi Need session mutex to read serial number.



details:   https://anonhg.NetBSD.org/src/rev/6b84dcbdce21
branches:  trunk
changeset: 815848:6b84dcbdce21
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jun 05 09:09:57 2016 +0000

description:
Need session mutex to read serial number.

diffstat:

 sys/dev/iscsi/iscsi_send.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 64447a5560da -r 6b84dcbdce21 sys/dev/iscsi/iscsi_send.c
--- a/sys/dev/iscsi/iscsi_send.c        Sun Jun 05 09:03:10 2016 +0000
+++ b/sys/dev/iscsi/iscsi_send.c        Sun Jun 05 09:09:57 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_send.c,v 1.27 2016/06/05 06:19:59 mlelstv Exp $  */
+/*     $NetBSD: iscsi_send.c,v 1.28 2016/06/05 09:09:57 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -629,7 +629,9 @@
 
        pdu->Opcode = IOP_Login_Request | OP_IMMEDIATE;
 
+       mutex_enter(&conn->session->lock);
        ccb->CmdSN = get_sernum(conn->session, false);
+       mutex_exit(&conn->session->lock);
 
        if (next) {
                c_phase = (pdu->Flags >> CSG_SHIFT) & SG_MASK;
@@ -741,7 +743,9 @@
        pdu->Opcode = IOP_Text_Request | OP_IMMEDIATE;
        pdu->Flags = FLAG_FINAL;
 
+       mutex_enter(&conn->session->lock);
        ccb->CmdSN = get_sernum(conn->session, false);
+       mutex_exit(&conn->session->lock);
 
        if (rx_pdu != NULL) {
                pdu->p.text_req.TargetTransferTag =



Home | Main Index | Thread Index | Old Index