From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Varoqui Subject: Re: [PATCH] mpathpersist: memset length is wrong Date: Tue, 11 Oct 2016 08:41:20 +0200 Message-ID: References: <1474447486-8892-1-git-send-email-tang.junhui@zte.com.cn> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1020458832872621179==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: tang.junhui@zte.com.cn Cc: Bart Van Assche , Vijay.Chauhan@netapp.com, device-mapper development , zhang.kai16@zte.com.cn List-Id: dm-devel.ids --===============1020458832872621179== Content-Type: multipart/alternative; boundary=001a1142bfc618f7d0053e912a3e --001a1142bfc618f7d0053e912a3e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Seems right. Merged, with thanks. On Tue, Oct 11, 2016 at 8:37 AM, wrote: > Please have a review for this patch, any comment will be highly > appreciated. > > > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: tang.junhui@zte.com.cn > =E6=94=B6=E4=BB=B6=E4=BA=BA: christophe varoqui , > Chauhan@redhat.com, Vijay , Benjamin Marzinski = < > bmarzins@redhat.com>, > =E6=8A=84=E9=80=81: zhang.kai16@zte.com.cn, dm-devel@redhat.com, "= tang.junhui" < > tang.junhui@zte.com.cn> > =E6=97=A5=E6=9C=9F: 2016/09/21 16:54 > =E4=B8=BB=E9=A2=98: [dm-devel] [PATCH] mpathpersist: memset length= is wrong > =E5=8F=91=E4=BB=B6=E4=BA=BA: dm-devel-bounces@redhat.com > ------------------------------ > > > > From: "tang.junhui" > > variable transportids is cleared by memset() with wrong length > MPATH_MX_TIDS, > the length should be MPATH_MX_TIDS*sizeof(struct transportid). > > Signed-off-by: tang.junhui > --- > mpathpersist/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mpathpersist/main.c b/mpathpersist/main.c > index a55865f..8e8cc35 100644 > --- a/mpathpersist/main.c > +++ b/mpathpersist/main.c > @@ -105,7 +105,7 @@ int main (int argc, char * argv[]) > > udev =3D udev_new(); > conf =3D mpath_lib_init(udev); > - memset(transportids,0,MPATH_MX_TIDS); > + memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct > transportid)); > multipath_conf =3D conf; > > while (1) > -- > 2.8.1.windows.1 > > -- > dm-devel mailing list > dm-devel@redhat.com > https://www.redhat.com/mailman/listinfo/dm-devel > > --001a1142bfc618f7d0053e912a3e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Seems right.
Merged, with thanks.

On Tue, Oct 11, 2016 at 8:= 37 AM, <tang.junhui@zte.com.cn> wrote:
Please have a review for this patch, any comment will be highly appreciated.




=E5=8F=91=E4=BB= =B6=E4=BA=BA: =C2=A0 =C2=A0 =C2=A0 =C2=A0 tang.junhui@zte.com.cn
=E6=94=B6=E4=BB= =B6=E4=BA=BA: =C2=A0 =C2=A0 =C2=A0 =C2=A0 christophe varoqui <christophe.varoqui@free.fr>, Chauhan@redhat.com, Vijay <Vijay.Chauhan@netapp.com>, Benjamin Marzinski <bmarzins@redhat.com>,
=E6=8A=84=E9=80= =81: =C2=A0 =C2=A0 =C2=A0 =C2=A0zhang.kai16@zte.com.cn, dm-devel@redhat.co= m, "tang.junhui" <tang.junhui@zte.com.cn>
=E6=97=A5=E6=9C= =9F: =C2=A0 =C2=A0 =C2=A0 =C2=A0 2016/09/21 16:54
=E4=B8=BB=E9=A2= =98: =C2=A0 =C2=A0 =C2=A0 =C2=A0[dm-devel] [PATCH] mpathpersist: memset length is wrong
=E5=8F=91=E4=BB= =B6=E4=BA=BA: =C2=A0 =C2=A0 =C2=A0 =C2=A0dm-devel-bounces@redhat.com<= /a>




From: "tang.junhui" <
tang.junhui@zte.com.cn><= br>
variable transportids is cleared by memset() with wrong length MPATH_MX_TID= S,
the length should be MPATH_MX_TIDS*sizeof(struct transportid).

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
---
mpathpersist/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mpathpersist/main.c b/mpathpersist/main.c
index a55865f..8e8cc35 100644
--- a/mpathpersist/main.c
+++ b/mpathpersist/main.c
@@ -105,7 +105,7 @@ int main (int argc, char * argv[])

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0udev =3D udev_new();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0conf =3D mpath_lib_init(udev);
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 memset(transportids,0,MPATH_MX_TIDS);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct transportid));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0multipath_co= nf =3D conf;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0while (1)
--
2.8.1.windows.1

--
dm-devel mailing list
dm-devel@redhat.co= m
https://www.redhat.com/mailman/li= stinfo/dm-devel


--001a1142bfc618f7d0053e912a3e-- --===============1020458832872621179== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1020458832872621179==--