<font size=3>Hello Hannes,</font>
<br>
<br><font size=3>Since this issue is introduced by RCU, can you have a
review for this patch?</font>
<br>
<br><font size=3>Thanks,</font>
<br><font size=3>Tang</font>
<br>
<br>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">发件人:
</font><font size=1 face="sans-serif">tang.wenji@zte.com.cn</font>
<br><font size=1 color=#5f5f5f face="sans-serif">收件人:
</font><font size=1 face="sans-serif">christophe
varoqui <christophe.varoqui@free.fr>, </font>
<br><font size=1 color=#5f5f5f face="sans-serif">抄送:
</font><font size=1 face="sans-serif">zhang.kai16@zte.com.cn,
dm-devel@redhat.com, tang.junhui@zte.com.cn, tang.wenji@zte.com.cn</font>
<br><font size=1 color=#5f5f5f face="sans-serif">日期:
</font><font size=1 face="sans-serif">2016/10/27
17:08</font>
<br><font size=1 color=#5f5f5f face="sans-serif">主题:
</font><font size=1 face="sans-serif">[dm-devel] [PATCH]
mpathpersistent: segment faulty occured in mpath_persistent_reserve_in()</font>
<br><font size=1 color=#5f5f5f face="sans-serif">发件人:
</font><font size=1 face="sans-serif">dm-devel-bounces@redhat.com</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>From: 10111224 <tang.wenji@zte.com.cn><br>
<br>
Segment faulty occured when executing "mpathpersist -i -k<br>
/dev/mapper/mpath1" command.The reason is that an uninitialized global
variable conf is used in mpath_persistent_reserve_in(). The same problem
also exists in<br>
mpath_persistent_reserve_out().<br>
<br>
Signed-off-by: tang.wenji <tang.wenji@zte.com.cn><br>
---<br>
libmpathpersist/mpath_persist.c | 21 +++++++++++++++++++--<br>
libmpathpersist/mpathpr.h | 4 ----<br>
2 files changed, 19 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c<br>
index 7501651..582d4ef 100644<br>
--- a/libmpathpersist/mpath_persist.c<br>
+++ b/libmpathpersist/mpath_persist.c<br>
@@ -78,6 +78,7 @@ updatepaths (struct multipath * mpp)<br>
int
i, j;<br>
struct
pathgroup * pgp;<br>
struct
path * pp;<br>
+
struct config *conf;<br>
<br>
if
(!mpp->pg)<br>
return 0;<br>
@@ -97,16 +98,24 @@ updatepaths (struct multipath * mpp)<br>
continue;<br>
}<br>
pp->mpp = mpp;<br>
+
conf
= get_multipath_config();<br>
pathinfo(pp, conf, DI_ALL);<br>
+
put_multipath_config(conf);<br>
continue;<br>
}<br>
pp->mpp
= mpp;<br>
if
(pp->state == PATH_UNCHECKED ||<br>
-
pp->state == PATH_WILD)<br>
+
pp->state == PATH_WILD){<br>
+
conf
= get_multipath_config();<br>
pathinfo(pp, conf, DI_CHECKER);<br>
+
put_multipath_config(conf);<br>
+
}<br>
<br>
-
if (pp->priority == PRIO_UNDEF)<br>
+
if (pp->priority == PRIO_UNDEF){<br>
+
conf
= get_multipath_config();<br>
pathinfo(pp, conf, DI_PRIO);<br>
+
put_multipath_config(conf);<br>
+
}<br>
}<br>
}<br>
return
0;<br>
@@ -159,8 +168,11 @@ int mpath_persistent_reserve_in (int fd, int rq_servact,<br>
int
map_present;<br>
int
major, minor;<br>
int
ret;<br>
+
struct config *conf;<br>
<br>
+
conf = get_multipath_config();<br>
conf->verbosity
= verbose;<br>
+
put_multipath_config( conf);<br>
<br>
if
(fstat( fd, &info) != 0){<br>
condlog(0, "stat error %d", fd);<br>
@@ -252,8 +264,11 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact,
int rq_scope,<br>
int
j;<br>
unsigned
char *keyp;<br>
uint64_t
prkey;<br>
+
struct config *conf;<br>
<br>
+
conf = get_multipath_config();<br>
conf->verbosity
= verbose;<br>
+
put_multipath_config(conf);<br>
<br>
if
(fstat( fd, &info) != 0){<br>
condlog(0, "stat error fd=%d", fd);<br>
@@ -320,7 +335,9 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact,
int rq_scope,<br>
goto out1;<br>
}<br>
<br>
+
conf = get_multipath_config();<br>
select_reservation_key(conf,
mpp);<br>
+
put_multipath_config(conf);<br>
<br>
switch(rq_servact)<br>
{<br>
diff --git a/libmpathpersist/mpathpr.h b/libmpathpersist/mpathpr.h<br>
index cd58201..e6c2ded 100644<br>
--- a/libmpathpersist/mpathpr.h<br>
+++ b/libmpathpersist/mpathpr.h<br>
@@ -25,10 +25,6 @@ struct threadinfo {<br>
struct
prout_param param;<br>
};<br>
<br>
-<br>
-struct config * conf;<br>
-<br>
-<br>
int prin_do_scsi_ioctl(char * dev, int rq_servact, struct prin_resp *
resp, int noisy);<br>
int prout_do_scsi_ioctl( char * dev, int rq_servact, int rq_scope,<br>
unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy);<br>
-- <br>
2.8.1.windows.1<br>
<br>
--<br>
dm-devel mailing list<br>
dm-devel@redhat.com<br>
</font></tt><a href="https://www.redhat.com/mailman/listinfo/dm-devel"><tt><font size=2>https://www.redhat.com/mailman/listinfo/dm-devel</font></tt></a><tt><font size=2><br>
</font></tt>
<br>