<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975">
<STYLE>@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
LI.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
DIV.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: windowtext; mso-style-type: personal-compose
}
.MsoChpDefault {
mso-style-type: export-only
}
DIV.WordSection1 {
page: WordSection1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US link=blue vLink=purple>
<DIV dir=ltr align=left><SPAN class=865570301-24112010><FONT color=#0000ff
size=2 face=Arial>What degree of testing has been performed with this
patch?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=865570301-24112010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=865570301-24112010><FONT color=#0000ff
size=2 face=Arial>thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=865570301-24112010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=865570301-24112010><FONT color=#0000ff
size=2 face=Arial>stan.</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Irena
Gannon<BR><B>Sent:</B> Tuesday, November 23, 2010 6:19 AM<BR><B>To:</B>
'ofw@lists.openfabrics.org'<BR><B>Subject:</B> [ofw] [patch][al] reg_mad_pool
error flow<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=WordSection1>
<P class=MsoNormal>Signed-off-by: Irena Gannon (<A
href="mailto:irena@mellanox.co.il">irena@mellanox.co.il</A>) <o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>This patch:<o:p></o:p></P>
<P class=MsoNormal>1. Adds ref to h_pool in both success and error flows of
reg_mad_pool as it is dereferenced in __cleanup_pool_key in both flows as
well<o:p></o:p></P>
<P class=MsoNormal>2. Prevents trying to remove a pool_item from a list if it
was not inserted into it<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Index:
B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c<o:p></o:p></P>
<P
class=MsoNormal>===================================================================<o:p></o:p></P>
<P class=MsoNormal>---
B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c
(revision 6890)<o:p></o:p></P>
<P class=MsoNormal>+++ B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c
(revision 6891)<o:p></o:p></P>
<P class=MsoNormal>@@ -366,6 +366,10 @@<o:p></o:p></P>
<P
class=MsoNormal>
return status;<o:p></o:p></P>
<P
class=MsoNormal>
}<o:p></o:p></P>
<P class=MsoNormal> <o:p></o:p></P>
<P
class=MsoNormal>+
//add ref to h_pool which is dereferenced in __cleanup_pool_key <o:p></o:p></P>
<P
class=MsoNormal>+
//in both success and error flow<o:p></o:p></P>
<P
class=MsoNormal>+
ref_al_obj( &h_pool->obj );<o:p></o:p></P>
<P class=MsoNormal>+<o:p></o:p></P>
<P
class=MsoNormal>
/* Register the pool on the protection domain. */<o:p></o:p></P>
<P
class=MsoNormal>
if( key_type == AL_KEY_NORMAL )<o:p></o:p></P>
<P
class=MsoNormal>
{<o:p></o:p></P>
<P class=MsoNormal>@@ -420,8 +424,6 @@<o:p></o:p></P>
<P
class=MsoNormal>
/* Add this pool_key to the AL instance. */<o:p></o:p></P>
<P
class=MsoNormal>
al_insert_key( h_al, p_pool_key );<o:p></o:p></P>
<P class=MsoNormal> <o:p></o:p></P>
<P
class=MsoNormal>-
ref_al_obj( &h_pool->obj );<o:p></o:p></P>
<P class=MsoNormal>-<o:p></o:p></P>
<P
class=MsoNormal>
/*<o:p></o:p></P>
<P
class=MsoNormal>
* Take a reference on the global pool_key for this CA, if it
exists.<o:p></o:p></P>
<P
class=MsoNormal>
* Note that the pool_key does not exist for the global MAD pool
in<o:p></o:p></P>
<P class=MsoNormal>@@ -528,7 +530,7 @@<o:p></o:p></P>
<P
class=MsoNormal>
* Remove the pool key from the pool to prevent further
registrations<o:p></o:p></P>
<P
class=MsoNormal>
* against this pool.<o:p></o:p></P>
<P
class=MsoNormal>
*/<o:p></o:p></P>
<P
class=MsoNormal>-
if( p_pool_key->type == AL_KEY_NORMAL )<o:p></o:p></P>
<P
class=MsoNormal>+
if( p_pool_key->type == AL_KEY_NORMAL &&
p_pool_key->pool_item.p_next != NULL)<o:p></o:p></P>
<P
class=MsoNormal>
{<o:p></o:p></P>
<P
class=MsoNormal>
cl_spinlock_acquire( &p_pool_key->h_pool->obj.lock );<o:p></o:p></P>
<P
class=MsoNormal>
cl_qlist_remove_item( &p_pool_key->h_pool->key_list,<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Thank you,<o:p></o:p></P>
<P class=MsoNormal>Irena<o:p></o:p></P></DIV></BODY></HTML>