Date: Mon, 4 Oct 2010 20:13:20 +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-8@freebsd.org Subject: svn commit: r213421 - stable/8/sys/dev/mpt Message-ID: <201010042013.o94KDKd8026005@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Mon Oct 4 20:13:19 2010 New Revision: 213421 URL: http://svn.freebsd.org/changeset/base/213421 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/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Oct 4 20:02:54 2010 (r213420) +++ stable/8/sys/dev/mpt/mpt.c Mon Oct 4 20:13:19 2010 (r213421) @@ -844,13 +844,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/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Oct 4 20:02:54 2010 (r213420) +++ stable/8/sys/dev/mpt/mpt.h Mon Oct 4 20:13:19 2010 (r213421) @@ -1157,19 +1157,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? */ @@ -1202,6 +1196,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.o94KDKd8026005>