Re: [PATCH] generic/297: fix the delta time based on stat

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Hi,

> On Fri, Jun 10, 2022 at 12:36:24PM +0800, Wang Yugui wrote:
> > Hi,
> > 
> > > On Fri, Jun 10, 2022 at 10:35:53AM +0800, Wang Yugui wrote:
> > > > stat -c '%Y' report seconds as int, so the delta 2.01s may result as 3s.
> > > > 
> > > > Signed-off-by: Wang Yugui <wangyugui@xxxxxxxxxxxx>
> > > > ---
> > > >  tests/generic/297 | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/tests/generic/297 b/tests/generic/297
> > > > index 6bdc3e1c..e3082202 100755
> > > > --- a/tests/generic/297
> > > > +++ b/tests/generic/297
> > > > @@ -51,7 +51,7 @@ for i in $(seq 0 $fnr); do
> > > >  	touch $TEST_DIR/after
> > > >  	before=$(stat -c '%Y' $TEST_DIR/before)
> > > >  	after=$(stat -c '%Y' $TEST_DIR/after)
> > > > -	delta=$((after - before))
> > > > +	delta=$((after - before -1)) # 2.01s may result as 3s; so -1
> > > 
> > > What issue is this change trying to fix? "timeout=8"s is not long enough?
> > 
> > for the command
> > $TIMEOUT_PROG -s INT ${kill_after}s
> > 
> > delta=$((after - before )) may report 'kill_after+1' in some case.
> > 
> > so no relationship to "timeout=8" or "timeout=2".
> > 
> > '$XFS_IO_PROG -f -c reflink' without '$TIMEOUT_PROG -s INT ${kill_after}s'
> > may take 20s because this is a very complex reflink.
> 
> Hmm... still don't understand what are you trying to fix.
> 
> That reflink operation need long time, that's expected. The first time it's
> running in a while loop for getting a proper testing size, no matter 8.01s
> or 9s, I think it's all good.
> 
> The second time the reflink run with `TIMEOUT_PROG 2s`, we expect it can be
> killed in 'timeout=8s', that's long enough. I think it's not necessary to
> care about it's keep running in 8.01s or 9s.

drop this patch please.

btrfs of generic/297 has a few freqency to fail.

maybe because  $XFS_IO_PROG is interrupt by timeout,
but the reflink inside kernel continue to finish.

Best Regards
Wang Yugui (wangyugui@xxxxxxxxxxxx)
2022/06/10





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux