diff mbox series

fcntl33: weakup child before exit if fail in parent

Message ID 20190430045746.1332-1-xzhou@redhat.com
State Accepted
Headers show
Series fcntl33: weakup child before exit if fail in parent | expand

Commit Message

Murphy Zhou April 30, 2019, 4:57 a.m. UTC
Now it failis on overlayfs this way:
fcntl33.c:120: INFO: .... failed on overlapfs as expected: EAGAIN/EWOULDBLOCK
tst_checkpoint.c:149: BROK: fcntl33.c:178: tst_checkpoint_wait(0, 10000): ETIMEDOUT
tst_test.c:357: BROK: Reported by child (12066)

Signed-off-by: Murphy Zhou <xzhou@redhat.com>
---
 testcases/kernel/syscalls/fcntl/fcntl33.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Li Wang April 30, 2019, 7:18 a.m. UTC | #1
On Tue, Apr 30, 2019 at 12:58 PM Murphy Zhou <xzhou@redhat.com> wrote:

> Now it failis on overlayfs this way:
> fcntl33.c:120: INFO: .... failed on overlapfs as expected:
> EAGAIN/EWOULDBLOCK
> tst_checkpoint.c:149: BROK: fcntl33.c:178: tst_checkpoint_wait(0, 10000):
> ETIMEDOUT
> tst_test.c:357: BROK: Reported by child (12066)
>

I'm wondering that if the parent failed to set lease, should child
still valuable to run the remaining test after it being wakened?


>
> Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> ---
>  testcases/kernel/syscalls/fcntl/fcntl33.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/testcases/kernel/syscalls/fcntl/fcntl33.c
> b/testcases/kernel/syscalls/fcntl/fcntl33.c
> index 43dc5a2af..ce27e1006 100644
> --- a/testcases/kernel/syscalls/fcntl/fcntl33.c
> +++ b/testcases/kernel/syscalls/fcntl/fcntl33.c
> @@ -121,6 +121,7 @@ static void do_test(unsigned int i)
>                 } else {
>                         tst_res(TFAIL | TTERRNO, "fcntl() failed to set
> lease");
>                 }
> +               TST_CHECKPOINT_WAKE(0);
>                 goto exit;
>         }
>
> --
> 2.21.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
Murphy Zhou April 30, 2019, 7:34 a.m. UTC | #2
On Tue, Apr 30, 2019 at 03:18:32PM +0800, Li Wang wrote:
> On Tue, Apr 30, 2019 at 12:58 PM Murphy Zhou <xzhou@redhat.com> wrote:
> 
> > Now it failis on overlayfs this way:
> > fcntl33.c:120: INFO: .... failed on overlapfs as expected:
> > EAGAIN/EWOULDBLOCK
> > tst_checkpoint.c:149: BROK: fcntl33.c:178: tst_checkpoint_wait(0, 10000):
> > ETIMEDOUT
> > tst_test.c:357: BROK: Reported by child (12066)
> >
> 
> I'm wondering that if the parent failed to set lease, should child
> still valuable to run the remaining test after it being wakened?

In do_child it just open file and calculate the time spent on it. Also
parent will reap the child before exit anyway. That checkpoint is needed
while everything goes fine, so even it's not that valuable to run the
remaining tests in child, it's not hurting though, :)

Thanks for reviewing!
--
M
> 
> 
> >
> > Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> > ---
> >  testcases/kernel/syscalls/fcntl/fcntl33.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/testcases/kernel/syscalls/fcntl/fcntl33.c
> > b/testcases/kernel/syscalls/fcntl/fcntl33.c
> > index 43dc5a2af..ce27e1006 100644
> > --- a/testcases/kernel/syscalls/fcntl/fcntl33.c
> > +++ b/testcases/kernel/syscalls/fcntl/fcntl33.c
> > @@ -121,6 +121,7 @@ static void do_test(unsigned int i)
> >                 } else {
> >                         tst_res(TFAIL | TTERRNO, "fcntl() failed to set
> > lease");
> >                 }
> > +               TST_CHECKPOINT_WAKE(0);
> >                 goto exit;
> >         }
> >
> > --
> > 2.21.0
> >
> >
> > --
> > Mailing list info: https://lists.linux.it/listinfo/ltp
> >
> 
> 
> -- 
> Regards,
> Li Wang
Li Wang April 30, 2019, 8:09 a.m. UTC | #3
On Tue, Apr 30, 2019 at 3:34 PM Murphy Zhou <xzhou@redhat.com> wrote:

> On Tue, Apr 30, 2019 at 03:18:32PM +0800, Li Wang wrote:
> > On Tue, Apr 30, 2019 at 12:58 PM Murphy Zhou <xzhou@redhat.com> wrote:
> >
> > > Now it failis on overlayfs this way:
> > > fcntl33.c:120: INFO: .... failed on overlapfs as expected:
> > > EAGAIN/EWOULDBLOCK
> > > tst_checkpoint.c:149: BROK: fcntl33.c:178: tst_checkpoint_wait(0,
> 10000):
> > > ETIMEDOUT
> > > tst_test.c:357: BROK: Reported by child (12066)
> > >
> >
> > I'm wondering that if the parent failed to set lease, should child
> > still valuable to run the remaining test after it being wakened?
>
> In do_child it just open file and calculate the time spent on it. Also
> parent will reap the child before exit anyway. That checkpoint is needed
> while everything goes fine, so even it's not that valuable to run the
> remaining tests in child, it's not hurting though, :)
>

Indeed, it sounds reasonable to me.

Reviewed-by: Li Wang <liwang@redhat.com>


>
> Thanks for reviewing!
> --
> M
> >
> >
> > >
> > > Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> > > ---
> > >  testcases/kernel/syscalls/fcntl/fcntl33.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/testcases/kernel/syscalls/fcntl/fcntl33.c
> > > b/testcases/kernel/syscalls/fcntl/fcntl33.c
> > > index 43dc5a2af..ce27e1006 100644
> > > --- a/testcases/kernel/syscalls/fcntl/fcntl33.c
> > > +++ b/testcases/kernel/syscalls/fcntl/fcntl33.c
> > > @@ -121,6 +121,7 @@ static void do_test(unsigned int i)
> > >                 } else {
> > >                         tst_res(TFAIL | TTERRNO, "fcntl() failed to set
> > > lease");
> > >                 }
> > > +               TST_CHECKPOINT_WAKE(0);
> > >                 goto exit;
> > >         }
> > >
> > > --
> > > 2.21.0
> > >
> > >
> > > --
> > > Mailing list info: https://lists.linux.it/listinfo/ltp
> > >
> >
> >
> > --
> > Regards,
> > Li Wang
>
Cyril Hrubis May 23, 2019, 1:45 p.m. UTC | #4
Hi!
Pushed, thanks.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/fcntl/fcntl33.c b/testcases/kernel/syscalls/fcntl/fcntl33.c
index 43dc5a2af..ce27e1006 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl33.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl33.c
@@ -121,6 +121,7 @@  static void do_test(unsigned int i)
 		} else {
 			tst_res(TFAIL | TTERRNO, "fcntl() failed to set lease");
 		}
+		TST_CHECKPOINT_WAKE(0);
 		goto exit;
 	}