Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Adapter leaks requests when mpt_event_notify_repl...



details:   https://anonhg.NetBSD.org/src/rev/7934b7438391
branches:  trunk
changeset: 809566:7934b7438391
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jul 22 08:33:51 2015 +0000

description:
Adapter leaks requests when mpt_event_notify_reply() has to acknowledge
an event leading to "adapter resource shortage" messages when the scsipi
subsystem tries to use all adapt_openings.

Change mpt_ctlop() to free the request on event MPI_FUNCTION_EVENT_ACK.

Tested on a SunFire X4275 with Symbios Logic SAS1068E (1000:0058, rev. 4).

diffstat:

 sys/dev/ic/mpt_netbsd.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r a4679f47b9ff -r 7934b7438391 sys/dev/ic/mpt_netbsd.c
--- a/sys/dev/ic/mpt_netbsd.c   Wed Jul 22 08:22:55 2015 +0000
+++ b/sys/dev/ic/mpt_netbsd.c   Wed Jul 22 08:33:51 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpt_netbsd.c,v 1.31 2014/09/28 11:27:00 jmcneill Exp $ */
+/*     $NetBSD: mpt_netbsd.c,v 1.32 2015/07/22 08:33:51 hannken Exp $  */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.31 2014/09/28 11:27:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.32 2015/07/22 08:33:51 hannken Exp $");
 
 #include "bio.h"
 
@@ -1270,8 +1270,16 @@
                break;
 
        case MPI_FUNCTION_EVENT_ACK:
+           {
+               MSG_EVENT_ACK_REPLY *msg = vmsg;
+               int index = le32toh(msg->MsgContext) & ~0x80000000;
                mpt_free_reply(mpt, (reply << 1));
+               if (index >= 0 && index < MPT_MAX_REQUESTS(mpt)) {
+                       request_t *req = &mpt->request_pool[index];
+                       mpt_free_request(mpt, req);
+               }
                break;
+           }
 
        case MPI_FUNCTION_PORT_ENABLE:
            {



Home | Main Index | Thread Index | Old Index