All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
@ 2014-02-21  7:51 Francesco RUNDO
  2014-02-21  8:02 ` Wanlong Gao
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21  7:51 UTC (permalink / raw)
  To: ltp-list

Changed exit code from TFAIL to TCONF  in case of unsupported
syscall. The "madvise" syscall needs kernel support as well as
fs support as -for specific advice- it requires specific filesystem
operations such as fallocate().
So, if kernel support is missed or fs doesn't provide specific
operation needed for such "advice" scenario of that syscall, the right
exit code (according to LTP defs) is not TFAIL as it is not a failure
but it is TCONF as the syscall is unsupported.

Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
---
 testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c
index b0c17e8..23dd9a6 100644
--- a/testcases/kernel/syscalls/madvise/madvise03.c
+++ b/testcases/kernel/syscalls/madvise/madvise03.c
@@ -160,10 +160,19 @@ static void cleanup(void)
 static void check_and_print(char *advice)
 {
 	if (TEST_RETURN == -1) {
-		tst_resm(TFAIL,
-			 "madvise test for %s failed with "
-			 "return = %ld, errno = %d : %s",
-			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
+		if (TEST_ERRNO != ENOTSUP) {
+			tst_resm(TFAIL,
+				 "madvise test for %s failed with "
+				 "return = %ld, errno = %d : %s",
+				 advice, TEST_RETURN, TEST_ERRNO,
+				 strerror(TEST_ERRNO));
+		} else {
+			tst_resm(TCONF,
+				"madvise test for %s unsupported "
+				"return = %ld, errno = %d : %s",
+				advice, TEST_RETURN, TEST_ERRNO,
+				strerror(TEST_ERRNO));
+		}
 	} else if (STD_FUNCTIONAL_TEST) {
 		tst_resm(TPASS, "madvise test for %s PASSED", advice);
 	}
-- 
1.7.7.6


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  7:51 [LTP] [PATCH] madvise/madvise03.c: Changed test exit code Francesco RUNDO
@ 2014-02-21  8:02 ` Wanlong Gao
  2014-02-21  8:38   ` Francesco RUNDO
  0 siblings, 1 reply; 14+ messages in thread
From: Wanlong Gao @ 2014-02-21  8:02 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list

On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> Changed exit code from TFAIL to TCONF  in case of unsupported
> syscall. The "madvise" syscall needs kernel support as well as
> fs support as -for specific advice- it requires specific filesystem
> operations such as fallocate().

Could you paste the running log on not supported system?

Thanks,
Wanlong Gao

> So, if kernel support is missed or fs doesn't provide specific
> operation needed for such "advice" scenario of that syscall, the right
> exit code (according to LTP defs) is not TFAIL as it is not a failure
> but it is TCONF as the syscall is unsupported.
> 
> Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> ---
>  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
>  1 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c
> index b0c17e8..23dd9a6 100644
> --- a/testcases/kernel/syscalls/madvise/madvise03.c
> +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> @@ -160,10 +160,19 @@ static void cleanup(void)
>  static void check_and_print(char *advice)
>  {
>  	if (TEST_RETURN == -1) {
> -		tst_resm(TFAIL,
> -			 "madvise test for %s failed with "
> -			 "return = %ld, errno = %d : %s",
> -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> +		if (TEST_ERRNO != ENOTSUP) {
> +			tst_resm(TFAIL,
> +				 "madvise test for %s failed with "
> +				 "return = %ld, errno = %d : %s",
> +				 advice, TEST_RETURN, TEST_ERRNO,
> +				 strerror(TEST_ERRNO));
> +		} else {
> +			tst_resm(TCONF,
> +				"madvise test for %s unsupported "
> +				"return = %ld, errno = %d : %s",
> +				advice, TEST_RETURN, TEST_ERRNO,
> +				strerror(TEST_ERRNO));
> +		}
>  	} else if (STD_FUNCTIONAL_TEST) {
>  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
>  	}
> 


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  8:02 ` Wanlong Gao
@ 2014-02-21  8:38   ` Francesco RUNDO
  2014-02-21  8:39     ` Wanlong Gao
  2014-02-21  9:08     ` Jan Stancek
  0 siblings, 2 replies; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21  8:38 UTC (permalink / raw)
  To: gaowanlong; +Cc: ltp-list

The requested log:

with patch:
madvise03    1  TCONF  :  madvise test for MADV_REMOVE unsupported return = -1, errno = 95 : Operation not supported
madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED

Without patch (original one):
madvise03    1  TFAIL  :  madvise test for MADV_REMOVE failed with return = -1, errno = 95 : Operation not supported
madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED


Regards,
FR

-----Original Message-----
From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] 
Sent: Friday, February 21, 2014 9:02 AM
To: Francesco RUNDO
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code

On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> Changed exit code from TFAIL to TCONF  in case of unsupported syscall. 
> The "madvise" syscall needs kernel support as well as fs support as 
> -for specific advice- it requires specific filesystem operations such 
> as fallocate().

Could you paste the running log on not supported system?

Thanks,
Wanlong Gao

> So, if kernel support is missed or fs doesn't provide specific 
> operation needed for such "advice" scenario of that syscall, the right 
> exit code (according to LTP defs) is not TFAIL as it is not a failure 
> but it is TCONF as the syscall is unsupported.
> 
> Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> ---
>  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
>  1 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise03.c 
> b/testcases/kernel/syscalls/madvise/madvise03.c
> index b0c17e8..23dd9a6 100644
> --- a/testcases/kernel/syscalls/madvise/madvise03.c
> +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
> check_and_print(char *advice)  {
>  	if (TEST_RETURN == -1) {
> -		tst_resm(TFAIL,
> -			 "madvise test for %s failed with "
> -			 "return = %ld, errno = %d : %s",
> -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> +		if (TEST_ERRNO != ENOTSUP) {
> +			tst_resm(TFAIL,
> +				 "madvise test for %s failed with "
> +				 "return = %ld, errno = %d : %s",
> +				 advice, TEST_RETURN, TEST_ERRNO,
> +				 strerror(TEST_ERRNO));
> +		} else {
> +			tst_resm(TCONF,
> +				"madvise test for %s unsupported "
> +				"return = %ld, errno = %d : %s",
> +				advice, TEST_RETURN, TEST_ERRNO,
> +				strerror(TEST_ERRNO));
> +		}
>  	} else if (STD_FUNCTIONAL_TEST) {
>  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
>  	}
> 


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  8:38   ` Francesco RUNDO
@ 2014-02-21  8:39     ` Wanlong Gao
  2014-02-21  9:08     ` Jan Stancek
  1 sibling, 0 replies; 14+ messages in thread
From: Wanlong Gao @ 2014-02-21  8:39 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list

On 02/21/2014 04:38 PM, Francesco RUNDO wrote:
> The requested log:
> 
> with patch:
> madvise03    1  TCONF  :  madvise test for MADV_REMOVE unsupported return = -1, errno = 95 : Operation not supported
> madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
> madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED
> 
> Without patch (original one):
> madvise03    1  TFAIL  :  madvise test for MADV_REMOVE failed with return = -1, errno = 95 : Operation not supported
> madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
> madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED

Thank you.

Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>


> 
> 
> Regards,
> FR
> 
> -----Original Message-----
> From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com] 
> Sent: Friday, February 21, 2014 9:02 AM
> To: Francesco RUNDO
> Cc: ltp-list@lists.sourceforge.net
> Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
>> Changed exit code from TFAIL to TCONF  in case of unsupported syscall. 
>> The "madvise" syscall needs kernel support as well as fs support as 
>> -for specific advice- it requires specific filesystem operations such 
>> as fallocate().
> 
> Could you paste the running log on not supported system?
> 
> Thanks,
> Wanlong Gao
> 
>> So, if kernel support is missed or fs doesn't provide specific 
>> operation needed for such "advice" scenario of that syscall, the right 
>> exit code (according to LTP defs) is not TFAIL as it is not a failure 
>> but it is TCONF as the syscall is unsupported.
>>
>> Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
>> ---
>>  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
>>  1 files changed, 13 insertions(+), 4 deletions(-)
>>
>> diff --git a/testcases/kernel/syscalls/madvise/madvise03.c 
>> b/testcases/kernel/syscalls/madvise/madvise03.c
>> index b0c17e8..23dd9a6 100644
>> --- a/testcases/kernel/syscalls/madvise/madvise03.c
>> +++ b/testcases/kernel/syscalls/madvise/madvise03.c
>> @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
>> check_and_print(char *advice)  {
>>  	if (TEST_RETURN == -1) {
>> -		tst_resm(TFAIL,
>> -			 "madvise test for %s failed with "
>> -			 "return = %ld, errno = %d : %s",
>> -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
>> +		if (TEST_ERRNO != ENOTSUP) {
>> +			tst_resm(TFAIL,
>> +				 "madvise test for %s failed with "
>> +				 "return = %ld, errno = %d : %s",
>> +				 advice, TEST_RETURN, TEST_ERRNO,
>> +				 strerror(TEST_ERRNO));
>> +		} else {
>> +			tst_resm(TCONF,
>> +				"madvise test for %s unsupported "
>> +				"return = %ld, errno = %d : %s",
>> +				advice, TEST_RETURN, TEST_ERRNO,
>> +				strerror(TEST_ERRNO));
>> +		}
>>  	} else if (STD_FUNCTIONAL_TEST) {
>>  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
>>  	}
>>
> 
> 


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  8:38   ` Francesco RUNDO
  2014-02-21  8:39     ` Wanlong Gao
@ 2014-02-21  9:08     ` Jan Stancek
  2014-02-21  9:21       ` Francesco RUNDO
  1 sibling, 1 reply; 14+ messages in thread
From: Jan Stancek @ 2014-02-21  9:08 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list



----- Original Message -----
> From: "Francesco RUNDO" <francesco.rundo@st.com>
> To: gaowanlong@cn.fujitsu.com
> Cc: ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 9:38:52 AM
> Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> The requested log:
> 
> with patch:
> madvise03    1  TCONF  :  madvise test for MADV_REMOVE unsupported return =
> -1, errno = 95 : Operation not supported
> madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
> madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED
> 
> Without patch (original one):
> madvise03    1  TFAIL  :  madvise test for MADV_REMOVE failed with return =
> -1, errno = 95 : Operation not supported
> madvise03    2  TPASS  :  madvise test for MADV_DONTFORK PASSED
> madvise03    3  TPASS  :  madvise test for MADV_DOFORK PASSED

Hi,

what kernel/architecture this fails with?
According to man page testcase should be using supported fs:

MADV_REMOVE (Since Linux 2.6.16)
    Free up a given range of pages and its associated backing store.
    Currently, only shmfs/tmpfs supports this; other file systems return with the
    error ENOSYS.

Regards,
Jan

> 
> 
> Regards,
> FR
> 
> -----Original Message-----
> From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> Sent: Friday, February 21, 2014 9:02 AM
> To: Francesco RUNDO
> Cc: ltp-list@lists.sourceforge.net
> Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > Changed exit code from TFAIL to TCONF  in case of unsupported syscall.
> > The "madvise" syscall needs kernel support as well as fs support as
> > -for specific advice- it requires specific filesystem operations such
> > as fallocate().
> 
> Could you paste the running log on not supported system?
> 
> Thanks,
> Wanlong Gao
> 
> > So, if kernel support is missed or fs doesn't provide specific
> > operation needed for such "advice" scenario of that syscall, the right
> > exit code (according to LTP defs) is not TFAIL as it is not a failure
> > but it is TCONF as the syscall is unsupported.
> > 
> > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > ---
> >  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
> >  1 files changed, 13 insertions(+), 4 deletions(-)
> > 
> > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > b/testcases/kernel/syscalls/madvise/madvise03.c
> > index b0c17e8..23dd9a6 100644
> > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > @@ -160,10 +160,19 @@ static void cleanup(void)  static void
> > check_and_print(char *advice)  {
> >  	if (TEST_RETURN == -1) {
> > -		tst_resm(TFAIL,
> > -			 "madvise test for %s failed with "
> > -			 "return = %ld, errno = %d : %s",
> > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > +		if (TEST_ERRNO != ENOTSUP) {
> > +			tst_resm(TFAIL,
> > +				 "madvise test for %s failed with "
> > +				 "return = %ld, errno = %d : %s",
> > +				 advice, TEST_RETURN, TEST_ERRNO,
> > +				 strerror(TEST_ERRNO));
> > +		} else {
> > +			tst_resm(TCONF,
> > +				"madvise test for %s unsupported "
> > +				"return = %ld, errno = %d : %s",
> > +				advice, TEST_RETURN, TEST_ERRNO,
> > +				strerror(TEST_ERRNO));
> > +		}
> >  	} else if (STD_FUNCTIONAL_TEST) {
> >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> >  	}
> > 
> 
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  9:08     ` Jan Stancek
@ 2014-02-21  9:21       ` Francesco RUNDO
  2014-02-21 10:06         ` Jan Stancek
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21  9:21 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

-----Original Message-----
From: Jan Stancek [mailto:jstancek@redhat.com] 
Sent: Friday, February 21, 2014 10:09 AM
>>Hi,
Hi,

>>what kernel/architecture this fails with?
I'm running on ARM arch with Kernel 3.10.27 and ext3 fs.

>>According to man page testcase should be using supported fs:
>>
>>MADV_REMOVE (Since Linux 2.6.16)
>>  Free up a given range of pages and its associated backing store.
>>    Currently, only shmfs/tmpfs supports this; other file systems return with the
>>    error ENOSYS.

Yes I noticed that but no specific check is included in testcase so it return TFAIL each time execution back with an error.
I think, according to LTP error defs, that the right exit code is TCONF when the test failed because it is executed on unsupported hw or sw (like unsupported fs).

Regards,
FR

>>Regards,
>>Jan


> 
> 
> Regards,
> FR
> 
> -----Original Message-----
> From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> Sent: Friday, February 21, 2014 9:02 AM
> To: Francesco RUNDO
> Cc: ltp-list@lists.sourceforge.net
> Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > Changed exit code from TFAIL to TCONF  in case of unsupported syscall.
> > The "madvise" syscall needs kernel support as well as fs support as 
> > -for specific advice- it requires specific filesystem operations 
> > such as fallocate().
> 
> Could you paste the running log on not supported system?
> 
> Thanks,
> Wanlong Gao
> 
> > So, if kernel support is missed or fs doesn't provide specific 
> > operation needed for such "advice" scenario of that syscall, the 
> > right exit code (according to LTP defs) is not TFAIL as it is not a 
> > failure but it is TCONF as the syscall is unsupported.
> > 
> > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > ---
> >  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
> >  1 files changed, 13 insertions(+), 4 deletions(-)
> > 
> > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > b/testcases/kernel/syscalls/madvise/madvise03.c
> > index b0c17e8..23dd9a6 100644
> > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
> > check_and_print(char *advice)  {
> >  	if (TEST_RETURN == -1) {
> > -		tst_resm(TFAIL,
> > -			 "madvise test for %s failed with "
> > -			 "return = %ld, errno = %d : %s",
> > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > +		if (TEST_ERRNO != ENOTSUP) {
> > +			tst_resm(TFAIL,
> > +				 "madvise test for %s failed with "
> > +				 "return = %ld, errno = %d : %s",
> > +				 advice, TEST_RETURN, TEST_ERRNO,
> > +				 strerror(TEST_ERRNO));
> > +		} else {
> > +			tst_resm(TCONF,
> > +				"madvise test for %s unsupported "
> > +				"return = %ld, errno = %d : %s",
> > +				advice, TEST_RETURN, TEST_ERRNO,
> > +				strerror(TEST_ERRNO));
> > +		}
> >  	} else if (STD_FUNCTIONAL_TEST) {
> >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> >  	}
> > 
> 
> 
> ----------------------------------------------------------------------
> -------- Managing the Performance of Cloud-Based Applications Take 
> advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> clktrk _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21  9:21       ` Francesco RUNDO
@ 2014-02-21 10:06         ` Jan Stancek
  2014-02-21 10:25           ` Francesco RUNDO
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Stancek @ 2014-02-21 10:06 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list





----- Original Message -----
> From: "Francesco RUNDO" <francesco.rundo@st.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 10:21:24 AM
> Subject: RE: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> -----Original Message-----
> From: Jan Stancek [mailto:jstancek@redhat.com]
> Sent: Friday, February 21, 2014 10:09 AM
> >>Hi,
> Hi,
> 
> >>what kernel/architecture this fails with?
> I'm running on ARM arch with Kernel 3.10.27 and ext3 fs.
> 
> >>According to man page testcase should be using supported fs:
> >>
> >>MADV_REMOVE (Since Linux 2.6.16)
> >>  Free up a given range of pages and its associated backing store.
> >>    Currently, only shmfs/tmpfs supports this; other file systems return
> >>    with the
> >>    error ENOSYS.
> 
> Yes I noticed that but no specific check is included in testcase so it return
> TFAIL each time execution back with an error.
> I think, according to LTP error defs, that the right exit code is TCONF when
> the test failed because it is executed on unsupported hw or sw (like
> unsupported fs).

Why should this case be unsupported when addr1 is backed by shared memory?
  TEST(madvise(addr1, 4096, MADV_REMOVE));


> 
> Regards,
> FR
> 
> >>Regards,
> >>Jan
> 
> 
> > 
> > 
> > Regards,
> > FR
> > 
> > -----Original Message-----
> > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > Sent: Friday, February 21, 2014 9:02 AM
> > To: Francesco RUNDO
> > Cc: ltp-list@lists.sourceforge.net
> > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> > 
> > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > Changed exit code from TFAIL to TCONF  in case of unsupported syscall.
> > > The "madvise" syscall needs kernel support as well as fs support as
> > > -for specific advice- it requires specific filesystem operations
> > > such as fallocate().
> > 
> > Could you paste the running log on not supported system?
> > 
> > Thanks,
> > Wanlong Gao
> > 
> > > So, if kernel support is missed or fs doesn't provide specific
> > > operation needed for such "advice" scenario of that syscall, the
> > > right exit code (according to LTP defs) is not TFAIL as it is not a
> > > failure but it is TCONF as the syscall is unsupported.
> > > 
> > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > ---
> > >  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
> > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > index b0c17e8..23dd9a6 100644
> > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void
> > > check_and_print(char *advice)  {
> > >  	if (TEST_RETURN == -1) {
> > > -		tst_resm(TFAIL,
> > > -			 "madvise test for %s failed with "
> > > -			 "return = %ld, errno = %d : %s",
> > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > +		if (TEST_ERRNO != ENOTSUP) {
> > > +			tst_resm(TFAIL,
> > > +				 "madvise test for %s failed with "
> > > +				 "return = %ld, errno = %d : %s",
> > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > +				 strerror(TEST_ERRNO));
> > > +		} else {
> > > +			tst_resm(TCONF,
> > > +				"madvise test for %s unsupported "
> > > +				"return = %ld, errno = %d : %s",
> > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > +				strerror(TEST_ERRNO));
> > > +		}
> > >  	} else if (STD_FUNCTIONAL_TEST) {
> > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > >  	}
> > > 
> > 
> > 
> > ----------------------------------------------------------------------
> > -------- Managing the Performance of Cloud-Based Applications Take
> > advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > clktrk _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > 
> 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 10:06         ` Jan Stancek
@ 2014-02-21 10:25           ` Francesco RUNDO
  2014-02-21 11:01             ` Jan Stancek
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21 10:25 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list


>>Why should this case be unsupported when addr1 is backed by shared memory?
>>  TEST(madvise(addr1, 4096, MADV_REMOVE));

The reported scenario MADV_REMOVE is managed -at kernel side- by madvise_remove() function on KERNEL_ROOT/mm/madvice.c.
From this file I got (mm/madvice.c):

==
static long madvise_remove(struct vm_area_struct *vma,
				struct vm_area_struct **prev,
				unsigned long start, unsigned long end)
{
[snip]
error = do_fallocate(f, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
		        offset, end - start);
[snip]
}
==

Now, "do_fallocate()" needs fallocate() op. but on ext3 this is not supported i.e. ENOTSUP.
This is the reason for which I consider this scenario as not supported and not ENOSYS as the system call is supported as the remaining scenarios worked fine (MADV_DONTFORK and MADV_DOFORK).

Regards
FR
> 
> Regards,
> FR
> 
> >>Regards,
> >>Jan
> 
> 
> > 
> > 
> > Regards,
> > FR
> > 
> > -----Original Message-----
> > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > Sent: Friday, February 21, 2014 9:02 AM
> > To: Francesco RUNDO
> > Cc: ltp-list@lists.sourceforge.net
> > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit 
> > code
> > 
> > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > Changed exit code from TFAIL to TCONF  in case of unsupported syscall.
> > > The "madvise" syscall needs kernel support as well as fs support 
> > > as -for specific advice- it requires specific filesystem 
> > > operations such as fallocate().
> > 
> > Could you paste the running log on not supported system?
> > 
> > Thanks,
> > Wanlong Gao
> > 
> > > So, if kernel support is missed or fs doesn't provide specific 
> > > operation needed for such "advice" scenario of that syscall, the 
> > > right exit code (according to LTP defs) is not TFAIL as it is not 
> > > a failure but it is TCONF as the syscall is unsupported.
> > > 
> > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > ---
> > >  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
> > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > index b0c17e8..23dd9a6 100644
> > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
> > > check_and_print(char *advice)  {
> > >  	if (TEST_RETURN == -1) {
> > > -		tst_resm(TFAIL,
> > > -			 "madvise test for %s failed with "
> > > -			 "return = %ld, errno = %d : %s",
> > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > +		if (TEST_ERRNO != ENOTSUP) {
> > > +			tst_resm(TFAIL,
> > > +				 "madvise test for %s failed with "
> > > +				 "return = %ld, errno = %d : %s",
> > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > +				 strerror(TEST_ERRNO));
> > > +		} else {
> > > +			tst_resm(TCONF,
> > > +				"madvise test for %s unsupported "
> > > +				"return = %ld, errno = %d : %s",
> > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > +				strerror(TEST_ERRNO));
> > > +		}
> > >  	} else if (STD_FUNCTIONAL_TEST) {
> > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > >  	}
> > > 
> > 
> > 
> > --------------------------------------------------------------------
> > --
> > -------- Managing the Performance of Cloud-Based Applications Take 
> > advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > Read the Whitepaper.
> > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > clktrk _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > 
> 
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 10:25           ` Francesco RUNDO
@ 2014-02-21 11:01             ` Jan Stancek
  2014-02-21 11:09               ` Jan Stancek
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Stancek @ 2014-02-21 11:01 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list



----- Original Message -----
> From: "Francesco RUNDO" <francesco.rundo@st.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 11:25:03 AM
> Subject: RE: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> 
> >>Why should this case be unsupported when addr1 is backed by shared memory?
> >>  TEST(madvise(addr1, 4096, MADV_REMOVE));
> 
> The reported scenario MADV_REMOVE is managed -at kernel side- by
> madvise_remove() function on KERNEL_ROOT/mm/madvice.c.
> From this file I got (mm/madvice.c):
> 
> ==
> static long madvise_remove(struct vm_area_struct *vma,
> 				struct vm_area_struct **prev,
> 				unsigned long start, unsigned long end)
> {
> [snip]
> error = do_fallocate(f, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> 		        offset, end - start);
> [snip]
> }
> ==
> 
> Now, "do_fallocate()" needs fallocate() op. but on ext3 this is not supported
> i.e. ENOTSUP.

This is the "unexpected part" for me. What I expect and get on x86_64
with 3.10 based kernel is call to shmem_fallocate():

madvise(start=0x7fcff6d66000 len_in=0x1000 behavior=0x9)
Call Trace:
 0xffffffff81150130 : shmem_fallocate+0x0/0x300 [kernel]
 0xffffffff8122d056 : shm_fallocate+0x26/0x40 [kernel]
 0xffffffff811a0089 : do_fallocate+0xf9/0x190 [kernel]
 0xffffffff8115ac95 : SyS_madvise+0x355/0x7a0 [kernel]
 0xffffffff815d05d9 : system_call_fastpath+0x16/0x1b [kernel]

Do you have possibility to run original testcase with strace?
# strace ./madvise03 2>&1 | grep -v abcdefghijklmnopqrstuvwxyz12345

Regards,
Jan

> This is the reason for which I consider this scenario as not supported and
> not ENOSYS as the system call is supported as the remaining scenarios worked
> fine (MADV_DONTFORK and MADV_DOFORK).
> 
> Regards
> FR
> > 
> > Regards,
> > FR
> > 
> > >>Regards,
> > >>Jan
> > 
> > 
> > > 
> > > 
> > > Regards,
> > > FR
> > > 
> > > -----Original Message-----
> > > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > > Sent: Friday, February 21, 2014 9:02 AM
> > > To: Francesco RUNDO
> > > Cc: ltp-list@lists.sourceforge.net
> > > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit
> > > code
> > > 
> > > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > > Changed exit code from TFAIL to TCONF  in case of unsupported syscall.
> > > > The "madvise" syscall needs kernel support as well as fs support
> > > > as -for specific advice- it requires specific filesystem
> > > > operations such as fallocate().
> > > 
> > > Could you paste the running log on not supported system?
> > > 
> > > Thanks,
> > > Wanlong Gao
> > > 
> > > > So, if kernel support is missed or fs doesn't provide specific
> > > > operation needed for such "advice" scenario of that syscall, the
> > > > right exit code (according to LTP defs) is not TFAIL as it is not
> > > > a failure but it is TCONF as the syscall is unsupported.
> > > > 
> > > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > > ---
> > > >  testcases/kernel/syscalls/madvise/madvise03.c |   17 +++++++++++++----
> > > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > index b0c17e8..23dd9a6 100644
> > > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void
> > > > check_and_print(char *advice)  {
> > > >  	if (TEST_RETURN == -1) {
> > > > -		tst_resm(TFAIL,
> > > > -			 "madvise test for %s failed with "
> > > > -			 "return = %ld, errno = %d : %s",
> > > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > > +		if (TEST_ERRNO != ENOTSUP) {
> > > > +			tst_resm(TFAIL,
> > > > +				 "madvise test for %s failed with "
> > > > +				 "return = %ld, errno = %d : %s",
> > > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > > +				 strerror(TEST_ERRNO));
> > > > +		} else {
> > > > +			tst_resm(TCONF,
> > > > +				"madvise test for %s unsupported "
> > > > +				"return = %ld, errno = %d : %s",
> > > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > > +				strerror(TEST_ERRNO));
> > > > +		}
> > > >  	} else if (STD_FUNCTIONAL_TEST) {
> > > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > > >  	}
> > > > 
> > > 
> > > 
> > > --------------------------------------------------------------------
> > > --
> > > -------- Managing the Performance of Cloud-Based Applications Take
> > > advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > > Read the Whitepaper.
> > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > > clktrk _______________________________________________
> > > Ltp-list mailing list
> > > Ltp-list@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > 
> > 
> 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 11:01             ` Jan Stancek
@ 2014-02-21 11:09               ` Jan Stancek
  2014-02-21 12:28                 ` Francesco RUNDO
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Stancek @ 2014-02-21 11:09 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list





----- Original Message -----
> From: "Jan Stancek" <jstancek@redhat.com>
> To: "Francesco RUNDO" <francesco.rundo@st.com>
> Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 12:01:22 PM
> Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> 
> 
> ----- Original Message -----
> > From: "Francesco RUNDO" <francesco.rundo@st.com>
> > To: "Jan Stancek" <jstancek@redhat.com>
> > Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> > Sent: Friday, 21 February, 2014 11:25:03 AM
> > Subject: RE: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> > 
> > 
> > >>Why should this case be unsupported when addr1 is backed by shared
> > >>memory?
> > >>  TEST(madvise(addr1, 4096, MADV_REMOVE));
> > 
> > The reported scenario MADV_REMOVE is managed -at kernel side- by
> > madvise_remove() function on KERNEL_ROOT/mm/madvice.c.
> > From this file I got (mm/madvice.c):
> > 
> > ==
> > static long madvise_remove(struct vm_area_struct *vma,
> > 				struct vm_area_struct **prev,
> > 				unsigned long start, unsigned long end)
> > {
> > [snip]
> > error = do_fallocate(f, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> > 		        offset, end - start);
> > [snip]
> > }
> > ==
> > 
> > Now, "do_fallocate()" needs fallocate() op. but on ext3 this is not
> > supported
> > i.e. ENOTSUP.
> 
> This is the "unexpected part" for me. What I expect and get on x86_64
> with 3.10 based kernel is call to shmem_fallocate():

Do you have kernel compiled with CONFIG_TMPFS=y?

Regards,
Jan

> 
> madvise(start=0x7fcff6d66000 len_in=0x1000 behavior=0x9)
> Call Trace:
>  0xffffffff81150130 : shmem_fallocate+0x0/0x300 [kernel]
>  0xffffffff8122d056 : shm_fallocate+0x26/0x40 [kernel]
>  0xffffffff811a0089 : do_fallocate+0xf9/0x190 [kernel]
>  0xffffffff8115ac95 : SyS_madvise+0x355/0x7a0 [kernel]
>  0xffffffff815d05d9 : system_call_fastpath+0x16/0x1b [kernel]
> 
> Do you have possibility to run original testcase with strace?
> # strace ./madvise03 2>&1 | grep -v abcdefghijklmnopqrstuvwxyz12345
> 
> Regards,
> Jan
> 
> > This is the reason for which I consider this scenario as not supported and
> > not ENOSYS as the system call is supported as the remaining scenarios
> > worked
> > fine (MADV_DONTFORK and MADV_DOFORK).
> > 
> > Regards
> > FR
> > > 
> > > Regards,
> > > FR
> > > 
> > > >>Regards,
> > > >>Jan
> > > 
> > > 
> > > > 
> > > > 
> > > > Regards,
> > > > FR
> > > > 
> > > > -----Original Message-----
> > > > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > > > Sent: Friday, February 21, 2014 9:02 AM
> > > > To: Francesco RUNDO
> > > > Cc: ltp-list@lists.sourceforge.net
> > > > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit
> > > > code
> > > > 
> > > > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > > > Changed exit code from TFAIL to TCONF  in case of unsupported
> > > > > syscall.
> > > > > The "madvise" syscall needs kernel support as well as fs support
> > > > > as -for specific advice- it requires specific filesystem
> > > > > operations such as fallocate().
> > > > 
> > > > Could you paste the running log on not supported system?
> > > > 
> > > > Thanks,
> > > > Wanlong Gao
> > > > 
> > > > > So, if kernel support is missed or fs doesn't provide specific
> > > > > operation needed for such "advice" scenario of that syscall, the
> > > > > right exit code (according to LTP defs) is not TFAIL as it is not
> > > > > a failure but it is TCONF as the syscall is unsupported.
> > > > > 
> > > > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > > > ---
> > > > >  testcases/kernel/syscalls/madvise/madvise03.c |   17
> > > > >  +++++++++++++----
> > > > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > > > 
> > > > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > index b0c17e8..23dd9a6 100644
> > > > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void
> > > > > check_and_print(char *advice)  {
> > > > >  	if (TEST_RETURN == -1) {
> > > > > -		tst_resm(TFAIL,
> > > > > -			 "madvise test for %s failed with "
> > > > > -			 "return = %ld, errno = %d : %s",
> > > > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > > > +		if (TEST_ERRNO != ENOTSUP) {
> > > > > +			tst_resm(TFAIL,
> > > > > +				 "madvise test for %s failed with "
> > > > > +				 "return = %ld, errno = %d : %s",
> > > > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > > > +				 strerror(TEST_ERRNO));
> > > > > +		} else {
> > > > > +			tst_resm(TCONF,
> > > > > +				"madvise test for %s unsupported "
> > > > > +				"return = %ld, errno = %d : %s",
> > > > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > > > +				strerror(TEST_ERRNO));
> > > > > +		}
> > > > >  	} else if (STD_FUNCTIONAL_TEST) {
> > > > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > > > >  	}
> > > > > 
> > > > 
> > > > 
> > > > --------------------------------------------------------------------
> > > > --
> > > > -------- Managing the Performance of Cloud-Based Applications Take
> > > > advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > > > Read the Whitepaper.
> > > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > > > clktrk _______________________________________________
> > > > Ltp-list mailing list
> > > > Ltp-list@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > > 
> > > 
> > 
> 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 11:09               ` Jan Stancek
@ 2014-02-21 12:28                 ` Francesco RUNDO
  2014-02-21 12:37                   ` Jan Stancek
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21 12:28 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list


> > Now, "do_fallocate()" needs fallocate() op. but on ext3 this is not 
> > supported i.e. ENOTSUP.

>>Do you have kernel compiled with CONFIG_TMPFS=y?

No. I've just checked kernel with above option: the reported madvise03 testcase worked fine (usage of shmem_fallocate()).
So your analysis of my scenario is corret.
Please , discard posted patch.

Thanks so much.
FR

> 
> madvise(start=0x7fcff6d66000 len_in=0x1000 behavior=0x9) Call Trace:
>  0xffffffff81150130 : shmem_fallocate+0x0/0x300 [kernel]
>  0xffffffff8122d056 : shm_fallocate+0x26/0x40 [kernel]
>  0xffffffff811a0089 : do_fallocate+0xf9/0x190 [kernel]
>  0xffffffff8115ac95 : SyS_madvise+0x355/0x7a0 [kernel]
>  0xffffffff815d05d9 : system_call_fastpath+0x16/0x1b [kernel]
> 
> Do you have possibility to run original testcase with strace?
> # strace ./madvise03 2>&1 | grep -v abcdefghijklmnopqrstuvwxyz12345
> 
> Regards,
> Jan
> 
> > This is the reason for which I consider this scenario as not 
> > supported and not ENOSYS as the system call is supported as the 
> > remaining scenarios worked fine (MADV_DONTFORK and MADV_DOFORK).
> > 
> > Regards
> > FR
> > > 
> > > Regards,
> > > FR
> > > 
> > > >>Regards,
> > > >>Jan
> > > 
> > > 
> > > > 
> > > > 
> > > > Regards,
> > > > FR
> > > > 
> > > > -----Original Message-----
> > > > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > > > Sent: Friday, February 21, 2014 9:02 AM
> > > > To: Francesco RUNDO
> > > > Cc: ltp-list@lists.sourceforge.net
> > > > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test 
> > > > exit code
> > > > 
> > > > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > > > Changed exit code from TFAIL to TCONF  in case of unsupported 
> > > > > syscall.
> > > > > The "madvise" syscall needs kernel support as well as fs 
> > > > > support as -for specific advice- it requires specific 
> > > > > filesystem operations such as fallocate().
> > > > 
> > > > Could you paste the running log on not supported system?
> > > > 
> > > > Thanks,
> > > > Wanlong Gao
> > > > 
> > > > > So, if kernel support is missed or fs doesn't provide specific 
> > > > > operation needed for such "advice" scenario of that syscall, 
> > > > > the right exit code (according to LTP defs) is not TFAIL as it 
> > > > > is not a failure but it is TCONF as the syscall is unsupported.
> > > > > 
> > > > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > > > ---
> > > > >  testcases/kernel/syscalls/madvise/madvise03.c |   17
> > > > >  +++++++++++++----
> > > > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > > > 
> > > > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > index b0c17e8..23dd9a6 100644
> > > > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
> > > > > check_and_print(char *advice)  {
> > > > >  	if (TEST_RETURN == -1) {
> > > > > -		tst_resm(TFAIL,
> > > > > -			 "madvise test for %s failed with "
> > > > > -			 "return = %ld, errno = %d : %s",
> > > > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > > > +		if (TEST_ERRNO != ENOTSUP) {
> > > > > +			tst_resm(TFAIL,
> > > > > +				 "madvise test for %s failed with "
> > > > > +				 "return = %ld, errno = %d : %s",
> > > > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > > > +				 strerror(TEST_ERRNO));
> > > > > +		} else {
> > > > > +			tst_resm(TCONF,
> > > > > +				"madvise test for %s unsupported "
> > > > > +				"return = %ld, errno = %d : %s",
> > > > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > > > +				strerror(TEST_ERRNO));
> > > > > +		}
> > > > >  	} else if (STD_FUNCTIONAL_TEST) {
> > > > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > > > >  	}
> > > > > 
> > > > 
> > > > 
> > > > ----------------------------------------------------------------
> > > > ----
> > > > --
> > > > -------- Managing the Performance of Cloud-Based Applications 
> > > > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> > > > Read the Whitepaper.
> > > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > > > clktrk _______________________________________________
> > > > Ltp-list mailing list
> > > > Ltp-list@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > > 
> > > 
> > 
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 12:28                 ` Francesco RUNDO
@ 2014-02-21 12:37                   ` Jan Stancek
  2014-02-21 12:42                     ` Francesco RUNDO
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Stancek @ 2014-02-21 12:37 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list



----- Original Message -----
> From: "Francesco RUNDO" <francesco.rundo@st.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 1:28:14 PM
> Subject: RE: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> 
> > > Now, "do_fallocate()" needs fallocate() op. but on ext3 this is not
> > > supported i.e. ENOTSUP.
> 
> >>Do you have kernel compiled with CONFIG_TMPFS=y?
> 
> No. I've just checked kernel with above option: the reported madvise03
> testcase worked fine (usage of shmem_fallocate()).
> So your analysis of my scenario is corret.
> Please , discard posted patch.

We can still handle this with some patch to skip first testcase if kernel is
compiled without "CONFIG_TMPFS=y". I think that qualifies as TCONF.
I'll leave it up to you.

Regards,
Jan

> 
> Thanks so much.
> FR
> 
> > 
> > madvise(start=0x7fcff6d66000 len_in=0x1000 behavior=0x9) Call Trace:
> >  0xffffffff81150130 : shmem_fallocate+0x0/0x300 [kernel]
> >  0xffffffff8122d056 : shm_fallocate+0x26/0x40 [kernel]
> >  0xffffffff811a0089 : do_fallocate+0xf9/0x190 [kernel]
> >  0xffffffff8115ac95 : SyS_madvise+0x355/0x7a0 [kernel]
> >  0xffffffff815d05d9 : system_call_fastpath+0x16/0x1b [kernel]
> > 
> > Do you have possibility to run original testcase with strace?
> > # strace ./madvise03 2>&1 | grep -v abcdefghijklmnopqrstuvwxyz12345
> > 
> > Regards,
> > Jan
> > 
> > > This is the reason for which I consider this scenario as not
> > > supported and not ENOSYS as the system call is supported as the
> > > remaining scenarios worked fine (MADV_DONTFORK and MADV_DOFORK).
> > > 
> > > Regards
> > > FR
> > > > 
> > > > Regards,
> > > > FR
> > > > 
> > > > >>Regards,
> > > > >>Jan
> > > > 
> > > > 
> > > > > 
> > > > > 
> > > > > Regards,
> > > > > FR
> > > > > 
> > > > > -----Original Message-----
> > > > > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > > > > Sent: Friday, February 21, 2014 9:02 AM
> > > > > To: Francesco RUNDO
> > > > > Cc: ltp-list@lists.sourceforge.net
> > > > > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test
> > > > > exit code
> > > > > 
> > > > > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > > > > Changed exit code from TFAIL to TCONF  in case of unsupported
> > > > > > syscall.
> > > > > > The "madvise" syscall needs kernel support as well as fs
> > > > > > support as -for specific advice- it requires specific
> > > > > > filesystem operations such as fallocate().
> > > > > 
> > > > > Could you paste the running log on not supported system?
> > > > > 
> > > > > Thanks,
> > > > > Wanlong Gao
> > > > > 
> > > > > > So, if kernel support is missed or fs doesn't provide specific
> > > > > > operation needed for such "advice" scenario of that syscall,
> > > > > > the right exit code (according to LTP defs) is not TFAIL as it
> > > > > > is not a failure but it is TCONF as the syscall is unsupported.
> > > > > > 
> > > > > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > > > > ---
> > > > > >  testcases/kernel/syscalls/madvise/madvise03.c |   17
> > > > > >  +++++++++++++----
> > > > > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > > > > 
> > > > > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > index b0c17e8..23dd9a6 100644
> > > > > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void
> > > > > > check_and_print(char *advice)  {
> > > > > >  	if (TEST_RETURN == -1) {
> > > > > > -		tst_resm(TFAIL,
> > > > > > -			 "madvise test for %s failed with "
> > > > > > -			 "return = %ld, errno = %d : %s",
> > > > > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > > > > +		if (TEST_ERRNO != ENOTSUP) {
> > > > > > +			tst_resm(TFAIL,
> > > > > > +				 "madvise test for %s failed with "
> > > > > > +				 "return = %ld, errno = %d : %s",
> > > > > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > > > > +				 strerror(TEST_ERRNO));
> > > > > > +		} else {
> > > > > > +			tst_resm(TCONF,
> > > > > > +				"madvise test for %s unsupported "
> > > > > > +				"return = %ld, errno = %d : %s",
> > > > > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > > > > +				strerror(TEST_ERRNO));
> > > > > > +		}
> > > > > >  	} else if (STD_FUNCTIONAL_TEST) {
> > > > > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > > > > >  	}
> > > > > > 
> > > > > 
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > ----
> > > > > --
> > > > > -------- Managing the Performance of Cloud-Based Applications
> > > > > Take advantage of what the Cloud has to offer - Avoid Common
> > > > > Pitfalls.
> > > > > Read the Whitepaper.
> > > > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > > > > clktrk _______________________________________________
> > > > > Ltp-list mailing list
> > > > > Ltp-list@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > > > 
> > > > 
> > > 
> >
> 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 12:37                   ` Jan Stancek
@ 2014-02-21 12:42                     ` Francesco RUNDO
  2014-02-25 17:59                       ` chrubis
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco RUNDO @ 2014-02-21 12:42 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list



-----Original Message-----
From: Jan Stancek [mailto:jstancek@redhat.com] 
Sent: Friday, February 21, 2014 1:38 PM
To: Francesco RUNDO
Cc: gaowanlong@cn.fujitsu.com; ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code



----- Original Message -----
> From: "Francesco RUNDO" <francesco.rundo@st.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: gaowanlong@cn.fujitsu.com, ltp-list@lists.sourceforge.net
> Sent: Friday, 21 February, 2014 1:28:14 PM
> Subject: RE: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
> 
> 
> > > Now, "do_fallocate()" needs fallocate() op. but on ext3 this is 
> > > not supported i.e. ENOTSUP.
> 
> >>Do you have kernel compiled with CONFIG_TMPFS=y?
> 
> No. I've just checked kernel with above option: the reported madvise03 
> testcase worked fine (usage of shmem_fallocate()).
> So your analysis of my scenario is corret.
> Please , discard posted patch.

>>We can still handle this with some patch to skip first testcase if kernel is compiled without "CONFIG_TMPFS=y". I think that qualifies as TCONF.
>>I'll leave it up to you.

Hmmm....yes... as TCONF(and not TFAIL) is of course the right exit code in case of TMPFS not enabled on kernel side.
I let you know...
Regards,
FR



>>Regards,
>>Jan

> 
> Thanks so much.
> FR
> 
> > 
> > madvise(start=0x7fcff6d66000 len_in=0x1000 behavior=0x9) Call Trace:
> >  0xffffffff81150130 : shmem_fallocate+0x0/0x300 [kernel]
> >  0xffffffff8122d056 : shm_fallocate+0x26/0x40 [kernel]
> >  0xffffffff811a0089 : do_fallocate+0xf9/0x190 [kernel]
> >  0xffffffff8115ac95 : SyS_madvise+0x355/0x7a0 [kernel]
> >  0xffffffff815d05d9 : system_call_fastpath+0x16/0x1b [kernel]
> > 
> > Do you have possibility to run original testcase with strace?
> > # strace ./madvise03 2>&1 | grep -v abcdefghijklmnopqrstuvwxyz12345
> > 
> > Regards,
> > Jan
> > 
> > > This is the reason for which I consider this scenario as not 
> > > supported and not ENOSYS as the system call is supported as the 
> > > remaining scenarios worked fine (MADV_DONTFORK and MADV_DOFORK).
> > > 
> > > Regards
> > > FR
> > > > 
> > > > Regards,
> > > > FR
> > > > 
> > > > >>Regards,
> > > > >>Jan
> > > > 
> > > > 
> > > > > 
> > > > > 
> > > > > Regards,
> > > > > FR
> > > > > 
> > > > > -----Original Message-----
> > > > > From: Wanlong Gao [mailto:gaowanlong@cn.fujitsu.com]
> > > > > Sent: Friday, February 21, 2014 9:02 AM
> > > > > To: Francesco RUNDO
> > > > > Cc: ltp-list@lists.sourceforge.net
> > > > > Subject: Re: [LTP] [PATCH] madvise/madvise03.c: Changed test 
> > > > > exit code
> > > > > 
> > > > > On 02/21/2014 03:51 PM, Francesco RUNDO wrote:
> > > > > > Changed exit code from TFAIL to TCONF  in case of 
> > > > > > unsupported syscall.
> > > > > > The "madvise" syscall needs kernel support as well as fs 
> > > > > > support as -for specific advice- it requires specific 
> > > > > > filesystem operations such as fallocate().
> > > > > 
> > > > > Could you paste the running log on not supported system?
> > > > > 
> > > > > Thanks,
> > > > > Wanlong Gao
> > > > > 
> > > > > > So, if kernel support is missed or fs doesn't provide 
> > > > > > specific operation needed for such "advice" scenario of that 
> > > > > > syscall, the right exit code (according to LTP defs) is not 
> > > > > > TFAIL as it is not a failure but it is TCONF as the syscall is unsupported.
> > > > > > 
> > > > > > Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
> > > > > > ---
> > > > > >  testcases/kernel/syscalls/madvise/madvise03.c |   17
> > > > > >  +++++++++++++----
> > > > > >  1 files changed, 13 insertions(+), 4 deletions(-)
> > > > > > 
> > > > > > diff --git a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > index b0c17e8..23dd9a6 100644
> > > > > > --- a/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > +++ b/testcases/kernel/syscalls/madvise/madvise03.c
> > > > > > @@ -160,10 +160,19 @@ static void cleanup(void)  static void 
> > > > > > check_and_print(char *advice)  {
> > > > > >  	if (TEST_RETURN == -1) {
> > > > > > -		tst_resm(TFAIL,
> > > > > > -			 "madvise test for %s failed with "
> > > > > > -			 "return = %ld, errno = %d : %s",
> > > > > > -			 advice, TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO));
> > > > > > +		if (TEST_ERRNO != ENOTSUP) {
> > > > > > +			tst_resm(TFAIL,
> > > > > > +				 "madvise test for %s failed with "
> > > > > > +				 "return = %ld, errno = %d : %s",
> > > > > > +				 advice, TEST_RETURN, TEST_ERRNO,
> > > > > > +				 strerror(TEST_ERRNO));
> > > > > > +		} else {
> > > > > > +			tst_resm(TCONF,
> > > > > > +				"madvise test for %s unsupported "
> > > > > > +				"return = %ld, errno = %d : %s",
> > > > > > +				advice, TEST_RETURN, TEST_ERRNO,
> > > > > > +				strerror(TEST_ERRNO));
> > > > > > +		}
> > > > > >  	} else if (STD_FUNCTIONAL_TEST) {
> > > > > >  		tst_resm(TPASS, "madvise test for %s PASSED", advice);
> > > > > >  	}
> > > > > > 
> > > > > 
> > > > > 
> > > > > --------------------------------------------------------------
> > > > > --
> > > > > ----
> > > > > --
> > > > > -------- Managing the Performance of Cloud-Based Applications 
> > > > > Take advantage of what the Cloud has to offer - Avoid Common 
> > > > > Pitfalls.
> > > > > Read the Whitepaper.
> > > > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.
> > > > > clktrk _______________________________________________
> > > > > Ltp-list mailing list
> > > > > Ltp-list@lists.sourceforge.net 
> > > > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > > > 
> > > > 
> > > 
> >
> 
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [LTP] [PATCH] madvise/madvise03.c: Changed test exit code
  2014-02-21 12:42                     ` Francesco RUNDO
@ 2014-02-25 17:59                       ` chrubis
  0 siblings, 0 replies; 14+ messages in thread
From: chrubis @ 2014-02-25 17:59 UTC (permalink / raw)
  To: Francesco RUNDO; +Cc: ltp-list

Hi!
> > > > Now, "do_fallocate()" needs fallocate() op. but on ext3 this is 
> > > > not supported i.e. ENOTSUP.
> > 
> > >>Do you have kernel compiled with CONFIG_TMPFS=y?
> > 
> > No. I've just checked kernel with above option: the reported madvise03 
> > testcase worked fine (usage of shmem_fallocate()).
> > So your analysis of my scenario is corret.
> > Please , discard posted patch.
> 
> >>We can still handle this with some patch to skip first testcase if kernel is compiled without "CONFIG_TMPFS=y". I think that qualifies as TCONF.
> >>I'll leave it up to you.
> 
> Hmmm....yes... as TCONF(and not TFAIL) is of course the right exit code in case of TMPFS not enabled on kernel side.
> I let you know...

Generally LTP tests should handle gracefully when syscall returns ENOSYS
or ENOTSUP, in reality only cases that has been catched by somebody are
handled.

What about following patch?

madvise/madvise03: Return TCONF on ENOTSUP

If support for TMPFS (CONFIG_TMPFS) is not compiled in kernel madvise
will return ENOTSUP for these testcases. Return TCONF rather than TFAIL
int this case.

Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/madvise/madvise03.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c
index aeae429..02b28d2 100644
--- a/testcases/kernel/syscalls/madvise/madvise03.c
+++ b/testcases/kernel/syscalls/madvise/madvise03.c
@@ -157,6 +157,11 @@ static void cleanup(void)
 static void check_and_print(char *advice)
 {
 	if (TEST_RETURN == -1) {
+		if (TEST_ERRNO == ENOTSUP && !strcmp(advice, "MADV_REMOVE")) {
+			tst_resm(TCONF, "madvise MADV_REMOVE returned ENOTSUP"
+			         " CONFIG_TMPFS=y not in kernel .config?");
+			return;
+		}
 		tst_resm(TFAIL,
 			 "madvise test for %s failed with "
 			 "return = %ld, errno = %d : %s",

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-02-25 17:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21  7:51 [LTP] [PATCH] madvise/madvise03.c: Changed test exit code Francesco RUNDO
2014-02-21  8:02 ` Wanlong Gao
2014-02-21  8:38   ` Francesco RUNDO
2014-02-21  8:39     ` Wanlong Gao
2014-02-21  9:08     ` Jan Stancek
2014-02-21  9:21       ` Francesco RUNDO
2014-02-21 10:06         ` Jan Stancek
2014-02-21 10:25           ` Francesco RUNDO
2014-02-21 11:01             ` Jan Stancek
2014-02-21 11:09               ` Jan Stancek
2014-02-21 12:28                 ` Francesco RUNDO
2014-02-21 12:37                   ` Jan Stancek
2014-02-21 12:42                     ` Francesco RUNDO
2014-02-25 17:59                       ` chrubis

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.