<div dir="ltr">Tang,<div><br></div><div>would you rebase this patch over upstream master please ?</div><div><br></div><div>Bart's commit 6e89fd1ec49da86555558acd63f05a4b4152a5c8 already moved the conf pointer declaration.</div><div><br></div><div>Thanks,</div><div>Christophe.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 4, 2016 at 5:23 PM, Benjamin Marzinski <span dir="ltr"><<a href="mailto:bmarzins@redhat.com" target="_blank">bmarzins@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Oct 27, 2016 at 04:55:28PM +0800, <a href="mailto:tang.wenji@zte.com.cn">tang.wenji@zte.com.cn</a> wrote:<br>
<br>
ACK<br>
<br>
-Ben<br>
<div class="HOEnZb"><div class="h5"><br>
> From: 10111224 <<a href="mailto:tang.wenji@zte.com.cn">tang.wenji@zte.com.cn</a>><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()<wbr>.<br>
><br>
> Signed-off-by: tang.wenji <<a href="mailto:tang.wenji@zte.com.cn">tang.wenji@zte.com.cn</a>><br>
> ---<br>
>  libmpathpersist/mpath_persist.<wbr>c | 21 +++++++++++++++++++--<br>
>  libmpathpersist/mpathpr.h       |  4 ----<br>
>  2 files changed, 19 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/libmpathpersist/mpath_<wbr>persist.c b/libmpathpersist/mpath_<wbr>persist.c<br>
> index 7501651..582d4ef 100644<br>
> --- a/libmpathpersist/mpath_<wbr>persist.c<br>
> +++ b/libmpathpersist/mpath_<wbr>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>
> <a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/dm-devel</a><br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/dm-devel</a><br>
</div></div></blockquote></div><br></div>