All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wei, Jiangang" <weijg.fnst@cn.fujitsu.com>
To: "Gao, Wanlong" <gaowanlong@cn.fujitsu.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH v2] kernel/syscalls/fallocate: fix array parameter degradation
Date: Tue, 12 May 2015 05:52:47 +0000	[thread overview]
Message-ID: <1431409964.1760.13.camel@localhost> (raw)
In-Reply-To: <55519334.8060608@cn.fujitsu.com>

On Tue, 2015-05-12 at 13:44 +0800, Wanlong Gao wrote:
> On 05/12/2015 01:43 PM, Wanlong Gao wrote:
> > On 05/07/2015 05:54 PM, Wei, Jiangang wrote:
> >> On Thu, 2015-05-07 at 12:37 +0300, Alexey Kodanev wrote:
> >>> Hi,
> >>> On 05/07/2015 09:17 AM, Wei,Jiangang wrote:
> >>>> Using 'sizeof' on array given as function argument
> >>>> returns size of a pointer, instead of the array's.
> >>>> So,
> >>>> It needs to pass an additional parameter size_t size
> >>>> indicating the number of elements in the array.
> >>>>
> >>>> Besides above,
> >>>> Set adjacent two bytes in 'exp_buf' to zero in test04().
> >>>>
> >>>> Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
> >>>> ---
> >>>>   testcases/kernel/syscalls/fallocate/fallocate04.c | 10 +++++-----
> >>>>   1 file changed, 5 insertions(+), 5 deletions(-)
> >>>>
> >>>> diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
> >>>> index 723c886..911bbe8 100644
> >>>> --- a/testcases/kernel/syscalls/fallocate/fallocate04.c
> >>>> +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
> >>>> @@ -98,9 +98,8 @@ static void setup(void)
> >>>>   	get_blocksize();
> >>>>   }
> >>>>   
> >>>> -static void check_file_data(const char exp_buf[])
> >>>> +static void check_file_data(const char exp_buf[], size_t size)
> >>>>   {
> >>>> -	size_t size = sizeof(exp_buf);
> >>>>   	char rbuf[size];
> >>>>   
> >>>>   	tst_resm(TINFO, "reading the file, compare with expected buffer");
> >>>> @@ -175,7 +174,7 @@ static void test02(void)
> >>>>   	fill_tst_buf(exp_buf);
> >>>>   	memset(exp_buf + block_size, 0, block_size);
> >>>>   
> >>>> -	check_file_data(exp_buf);
> >>>> +	check_file_data(exp_buf, buf_size);
> >>>>   
> >>>>   	tst_resm(TPASS, "test-case succeeded");
> >>>>   }
> >>>> @@ -215,7 +214,7 @@ static void test03(void)
> >>>>   	fill_tst_buf(exp_buf);
> >>>>   	memset(exp_buf + block_size - 1, 0, block_size + 2);
> >>>>   
> >>>> -	check_file_data(exp_buf);
> >>>> +	check_file_data(exp_buf, buf_size);
> >>>>   
> >>>>   	tst_resm(TPASS, "test-case succeeded");
> >>>>   }
> >>>> @@ -251,7 +250,8 @@ static void test04(void)
> >>>>   	memcpy(exp_buf, tmp_buf, block_size);
> >>>>   	memcpy(exp_buf + block_size, tmp_buf + size, block_size);
> >>>>   
> >>>> -	check_file_data(exp_buf);
> >>>> +	exp_buf[block_size - 1] = exp_buf[block_size] = '\0';
> >>>> +	check_file_data(exp_buf, size);
> >>>>   
> >>>>   	tst_resm(TPASS, "test-case succeeded");
> >>>>   }
> >>>
> >>> Patch applied, thank you!
> >>
> >> Thank you for your feedback so quickly.
> >> Do you have noticed the other commit?
> >>  ->[PATCH 3/3] kernel/mem/mmapstress: fix resource leak
> >>
> >> I guess it might have been ignored...
> > 
> > It's a bit messy, would you repost your patches which were
> > not applied to make things more clearly?
> 
> And start a new mail thread.
OK, I got it.

Regards,
Wei
> 
> Thanks,
> Wanlong Gao
> 
> > 
> > Thanks,
> > Wanlong Gao
> > 
> >>
> >> Thanks again,
> >> Wei
> >>>
> >>> Best regards,
> >>> Alexey
> >>>
> >>>
> >>
> >> ------------------------------------------------------------------------------
> >> One dashboard for servers and applications across Physical-Virtual-Cloud 
> >> Widest out-of-the-box monitoring support with 50+ applications
> >> Performance metrics, stats and reports that give you Actionable Insights
> >> Deep dive visibility with transaction tracing using APM Insight.
> >> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> >> _______________________________________________
> >> Ltp-list mailing list
> >> Ltp-list@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/ltp-list
> >> .
> >>
> > 
> > .
> > 
> 

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-05-12  5:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 10:18 [LTP] [PATCH 1/3] kernel/syscalls/fallocate: fix array parameter degradation Wei,Jiangang
2015-05-06 10:18 ` [LTP] [PATCH 2/3] kernel/syscalls/fallocate: specify size needs check Wei,Jiangang
2015-05-06 20:42   ` Alexey Kodanev
2015-05-07  4:53     ` Wei, Jiangang
2015-05-07  6:17     ` [LTP] [PATCH v2] kernel/syscalls/fallocate: fix array parameter degradation Wei,Jiangang
2015-05-07  9:37       ` Alexey Kodanev
2015-05-07  9:54         ` Wei, Jiangang
2015-05-12  5:43           ` Wanlong Gao
2015-05-12  5:44             ` Wanlong Gao
2015-05-12  5:52               ` Wei, Jiangang [this message]
2015-05-06 10:18 ` [LTP] [PATCH 3/3] kernel/mem/mmapstress: fix resource leak Wei,Jiangang
2015-05-07 14:05   ` Alexey Kodanev
2015-05-08  6:42     ` Wei, Jiangang
2015-05-12  9:12       ` Cyril Hrubis
2015-05-13 12:03       ` Alexey Kodanev
2015-05-08  6:47     ` [LTP] [PATCH v2] " Wei,Jiangang
2015-05-19  3:34   ` [LTP] [PATCH] mmapstress01: Modify readbuf's type and define it to uchar_t Zeng Linggang
2015-05-19  9:23     ` Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431409964.1760.13.camel@localhost \
    --to=weijg.fnst@cn.fujitsu.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.