All of lore.kernel.org
 help / color / mirror / Atom feed
* pwrite04 ltp bug?
@ 2016-05-20 20:51 Mike Marshall
       [not found] ` <CADVQ27oBdCxfuVmknYa16RTXpnYgncn94VnutMgn2+9VD-9bcg@mail.gmail.com>
  2016-05-21 11:43 ` Eryu Guan
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Marshall @ 2016-05-20 20:51 UTC (permalink / raw)
  To: linux-fsdevel, Mike Marshall

Hi everyone...

While fixing a couple of LTP regressions in the out-of-tree Orangefs
kernel module, I think I found a problem with the pwrite04 test,
here's what I think was meant:

# git diff testcases/kernel/syscalls/pwrite/pwrite04.c
diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
b/testcases/kernel/syscalls/pwrite/pwrite04.c
index b297682..4ca7dc1 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite04.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
@@ -196,9 +196,9 @@ int main(int ac, char *av[])

                }
                if (statbuf.st_size != K5) {
-                       tst_resm(TFAIL, "file size is %ld != K4",
+                       tst_resm(TFAIL, "file size is %ld != K5",
                                 statbuf.st_size);
-
+                       cleanup();
                }
                tst_resm(TPASS, "O_APPEND test passed.");

Should I even be talking about this here, or should I go find
the github maintainers of LTP and ask them about it?

-Mike

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

* [LTP] Fwd: pwrite04 ltp bug?
       [not found]   ` <CADVQ27q119e2Oqg0tVGDjc_8yjoXvQHbg=Tqd9n4jxu8tedRVg@mail.gmail.com>
@ 2016-05-21  2:07     ` Mike Marshall
  2016-05-23 12:39       ` Cyril Hrubis
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Marshall @ 2016-05-21  2:07 UTC (permalink / raw)
  To: ltp

Hi...

I think I found a bug in pwrite04.c. I mentioned it on the linux
filesystem mailing list and it was suggested that I mention it to
you...

-Mike

Forwarded conversation
Subject: pwrite04 ltp bug?
------------------------

From: *Mike Marshall* <hubcap@omnibond.com>
Date: Fri, May 20, 2016 at 4:51 PM
To: linux-fsdevel <linux-fsdevel@vger.kernel.org>, Mike Marshall <
hubcap@omnibond.com>


Hi everyone...

While fixing a couple of LTP regressions in the out-of-tree Orangefs
kernel module, I think I found a problem with the pwrite04 test,
here's what I think was meant:

# git diff testcases/kernel/syscalls/pwrite/pwrite04.c
diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
b/testcases/kernel/syscalls/pwrite/pwrite04.c
index b297682..4ca7dc1 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite04.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
@@ -196,9 +196,9 @@ int main(int ac, char *av[])

                }
                if (statbuf.st_size != K5) {
-                       tst_resm(TFAIL, "file size is %ld != K4",
+                       tst_resm(TFAIL, "file size is %ld != K5",
                                 statbuf.st_size);
-
+                       cleanup();
                }
                tst_resm(TPASS, "O_APPEND test passed.");

Should I even be talking about this here, or should I go find
the github maintainers of LTP and ask them about it?

-Mike

----------
From: *Zorro Lang* <zorro.lang@gmail.com>
Date: Fri, May 20, 2016 at 8:56 PM
To: Mike Marshall <hubcap@omnibond.com>



2016年5月21日 04:52,"Mike Marshall" <hubcap@omnibond.com>写道:
>
> Hi everyone...
>
> While fixing a couple of LTP regressions in the out-of-tree Orangefs
> kernel module, I think I found a problem with the pwrite04 test,
> here's what I think was meant:
>
> # git diff testcases/kernel/syscalls/pwrite/pwrite04.c
> diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
> b/testcases/kernel/syscalls/pwrite/pwrite04.c
> index b297682..4ca7dc1 100644
> --- a/testcases/kernel/syscalls/pwrite/pwrite04.c
> +++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
> @@ -196,9 +196,9 @@ int main(int ac, char *av[])
>
>                 }
>                 if (statbuf.st_size != K5) {
> -                       tst_resm(TFAIL, "file size is %ld != K4",
> +                       tst_resm(TFAIL, "file size is %ld != K5",
>                                  statbuf.st_size);
> -
> +                       cleanup();
>                 }
>                 tst_resm(TPASS, "O_APPEND test passed.");
>
> Should I even be talking about this here, or should I go find
> the github maintainers of LTP and ask them about it?

Hi Mike,

Generally, we send LTP related patches to: ltp@lists.linux.it

Thanks,
Zorro

>
> -Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel"
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160520/a1d8e5d4/attachment.html>

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

* Re: pwrite04 ltp bug?
  2016-05-20 20:51 pwrite04 ltp bug? Mike Marshall
       [not found] ` <CADVQ27oBdCxfuVmknYa16RTXpnYgncn94VnutMgn2+9VD-9bcg@mail.gmail.com>
@ 2016-05-21 11:43 ` Eryu Guan
  1 sibling, 0 replies; 6+ messages in thread
From: Eryu Guan @ 2016-05-21 11:43 UTC (permalink / raw)
  To: Mike Marshall; +Cc: linux-fsdevel

On Fri, May 20, 2016 at 04:51:30PM -0400, Mike Marshall wrote:
> Hi everyone...
> 
> While fixing a couple of LTP regressions in the out-of-tree Orangefs
> kernel module, I think I found a problem with the pwrite04 test,
> here's what I think was meant:
> 
> # git diff testcases/kernel/syscalls/pwrite/pwrite04.c
> diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
> b/testcases/kernel/syscalls/pwrite/pwrite04.c
> index b297682..4ca7dc1 100644
> --- a/testcases/kernel/syscalls/pwrite/pwrite04.c
> +++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
> @@ -196,9 +196,9 @@ int main(int ac, char *av[])
> 
>                 }
>                 if (statbuf.st_size != K5) {
> -                       tst_resm(TFAIL, "file size is %ld != K4",
> +                       tst_resm(TFAIL, "file size is %ld != K5",
>                                  statbuf.st_size);
> -
> +                       cleanup();
>                 }
>                 tst_resm(TPASS, "O_APPEND test passed.");
> 
> Should I even be talking about this here, or should I go find
> the github maintainers of LTP and ask them about it?

Can you please send a patch to ltp list (ltp@lists.linux.it)? That's
where ltp developments and discussions happen.

Thanks,
Eryu

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

* [LTP] Fwd: pwrite04 ltp bug?
  2016-05-21  2:07     ` [LTP] Fwd: " Mike Marshall
@ 2016-05-23 12:39       ` Cyril Hrubis
  2016-05-23 15:03         ` Mike Marshall
  0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2016-05-23 12:39 UTC (permalink / raw)
  To: ltp

Hi!
> While fixing a couple of LTP regressions in the out-of-tree Orangefs
> kernel module, I think I found a problem with the pwrite04 test,
> here's what I think was meant:
> 
> # git diff testcases/kernel/syscalls/pwrite/pwrite04.c
> diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
> b/testcases/kernel/syscalls/pwrite/pwrite04.c
> index b297682..4ca7dc1 100644
> --- a/testcases/kernel/syscalls/pwrite/pwrite04.c
> +++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
> @@ -196,9 +196,9 @@ int main(int ac, char *av[])
> 
>                 }
>                 if (statbuf.st_size != K5) {
> -                       tst_resm(TFAIL, "file size is %ld != K4",
> +                       tst_resm(TFAIL, "file size is %ld != K5",
>                                  statbuf.st_size);

This is obvious typo fix.

> -
> +                       cleanup();

This does not look right. Looking at the test source the rest of the ifs
has the cleanup right after tst_resm() but the cleanup() fuction is
supposed to be called exactly once at the end of the test at the end of
the main.

If it's called in the testing loop the test will fail when cleanup() is
invoked second time at the test exit since it will attempt to remove
allready deleted test temporary directory. So the correct solution to
this problem would rather be to remove the cleanup() from the test loop.

>                 }
>                 tst_resm(TPASS, "O_APPEND test passed.");

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] Fwd: pwrite04 ltp bug?
  2016-05-23 12:39       ` Cyril Hrubis
@ 2016-05-23 15:03         ` Mike Marshall
  2016-05-23 15:43           ` Cyril Hrubis
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Marshall @ 2016-05-23 15:03 UTC (permalink / raw)
  To: ltp

 > This does not look right...

OK, I was just copying the file size test
loop above the "Finally" comment, I assumed
that cleanup exited. As it is, if you fail the
file size loop I edited,  you'll get both a FAIL
and a PASS...

Maybe in all the cases that resolve to FAIL
we should goto some kind of out-fail: ?

Thanks for looking...

-Mike

On Mon, May 23, 2016 at 8:39 AM, Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
>> While fixing a couple of LTP regressions in the out-of-tree Orangefs
>> kernel module, I think I found a problem with the pwrite04 test,
>> here's what I think was meant:
>>
>> # git diff testcases/kernel/syscalls/pwrite/pwrite04.c
>> diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c
>> b/testcases/kernel/syscalls/pwrite/pwrite04.c
>> index b297682..4ca7dc1 100644
>> --- a/testcases/kernel/syscalls/pwrite/pwrite04.c
>> +++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
>> @@ -196,9 +196,9 @@ int main(int ac, char *av[])
>>
>>                 }
>>                 if (statbuf.st_size != K5) {
>> -                       tst_resm(TFAIL, "file size is %ld != K4",
>> +                       tst_resm(TFAIL, "file size is %ld != K5",
>>                                  statbuf.st_size);
>
> This is obvious typo fix.
>
>> -
>> +                       cleanup();
>
> This does not look right. Looking at the test source the rest of the ifs
> has the cleanup right after tst_resm() but the cleanup() fuction is
> supposed to be called exactly once at the end of the test at the end of
> the main.
>
> If it's called in the testing loop the test will fail when cleanup() is
> invoked second time at the test exit since it will attempt to remove
> allready deleted test temporary directory. So the correct solution to
> this problem would rather be to remove the cleanup() from the test loop.
>
>>                 }
>>                 tst_resm(TPASS, "O_APPEND test passed.");
>
> --
> Cyril Hrubis
> chrubis@suse.cz

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

* [LTP] Fwd: pwrite04 ltp bug?
  2016-05-23 15:03         ` Mike Marshall
@ 2016-05-23 15:43           ` Cyril Hrubis
  0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2016-05-23 15:43 UTC (permalink / raw)
  To: ltp

Hi!
>  > This does not look right...
> 
> OK, I was just copying the file size test
> loop above the "Finally" comment, I assumed
> that cleanup exited. As it is, if you fail the
> file size loop I edited,  you'll get both a FAIL
> and a PASS...
> 
> Maybe in all the cases that resolve to FAIL
> we should goto some kind of out-fail: ?

The best solution would to move the actual test to a separate function
called from the for() loop in main(), then we can just do return in case
of failure.

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2016-05-23 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20 20:51 pwrite04 ltp bug? Mike Marshall
     [not found] ` <CADVQ27oBdCxfuVmknYa16RTXpnYgncn94VnutMgn2+9VD-9bcg@mail.gmail.com>
     [not found]   ` <CADVQ27q119e2Oqg0tVGDjc_8yjoXvQHbg=Tqd9n4jxu8tedRVg@mail.gmail.com>
2016-05-21  2:07     ` [LTP] Fwd: " Mike Marshall
2016-05-23 12:39       ` Cyril Hrubis
2016-05-23 15:03         ` Mike Marshall
2016-05-23 15:43           ` Cyril Hrubis
2016-05-21 11:43 ` Eryu Guan

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.