Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Oct 2010 20:13:21 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r213422 - stable/7/sys/dev/mpt
Message-ID:  <201010042013.o94KDLAv026036@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Mon Oct  4 20:13:21 2010
New Revision: 213422
URL: http://svn.freebsd.org/changeset/base/213422

Log:
  MFC: r213105, r213147
  
  Improve r56796; the reply handler actually may remove the request from
  the chain in which case it shouldn't be removed twice.
  Reported by:	Staale Kristoffersen

Modified:
  stable/7/sys/dev/mpt/mpt.c
  stable/7/sys/dev/mpt/mpt.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/mpt/mpt.c
==============================================================================
--- stable/7/sys/dev/mpt/mpt.c	Mon Oct  4 20:13:19 2010	(r213421)
+++ stable/7/sys/dev/mpt/mpt.c	Mon Oct  4 20:13:21 2010	(r213422)
@@ -842,13 +842,14 @@ mpt_complete_request_chain(struct mpt_so
 		MSG_REQUEST_HEADER *msg_hdr;
 		u_int		    cb_index;
 
-		TAILQ_REMOVE(chain, req, links);
 		msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf;
 		ioc_status_frame.Function = msg_hdr->Function;
 		ioc_status_frame.MsgContext = msg_hdr->MsgContext;
 		cb_index = MPT_CONTEXT_TO_CBI(le32toh(msg_hdr->MsgContext));
 		mpt_reply_handlers[cb_index](mpt, req, msg_hdr->MsgContext,
 		    &ioc_status_frame);
+		if (mpt_req_on_pending_list(mpt, req) != 0)
+			TAILQ_REMOVE(chain, req, links);
 	}
 }
 

Modified: stable/7/sys/dev/mpt/mpt.h
==============================================================================
--- stable/7/sys/dev/mpt/mpt.h	Mon Oct  4 20:13:19 2010	(r213421)
+++ stable/7/sys/dev/mpt/mpt.h	Mon Oct  4 20:13:21 2010	(r213422)
@@ -1155,19 +1155,13 @@ mpt_tag_2_req(struct mpt_softc *mpt, uin
 	KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer"));
 	return (mpt->tgt_cmd_ptrs[rtg]);
 }
-
+#endif
 
 static __inline int
 mpt_req_on_free_list(struct mpt_softc *, request_t *);
 static __inline int
 mpt_req_on_pending_list(struct mpt_softc *, request_t *);
 
-static __inline void
-mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int);
-static __inline void
-mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int);
-
-
 /*
  * Is request on freelist?
  */
@@ -1200,6 +1194,12 @@ mpt_req_on_pending_list(struct mpt_softc
 	return (0);
 }
 
+#ifdef	INVARIANTS
+static __inline void
+mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int);
+static __inline void
+mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int);
+
 /*
  * Make sure that req *is* part of one of the special lists
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010042013.o94KDLAv026036>