Re: [PATCH] generic/019: kill background processes on interrupt

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



On Tue, Apr 12, 2022 at 02:59:42PM +0200, David Disseldorp wrote:
> On Mon, 11 Apr 2022 15:48:33 +1000, Dave Chinner wrote:
> 
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > If you ctrl-c generic/019, it leaves fsstress processes running.
> > Kill them in the cleanup function so that they don't have to be
> > manually killed after interrupting the test.
> > 
> > While touching the _cleanup() function, make it do everything that
> > the generic _cleanup function it overrides does and fix the
> > indenting.
> > 
> > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> > ---
> >  tests/generic/019 | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/generic/019 b/tests/generic/019
> > index db56dac1..cda107f4 100755
> > --- a/tests/generic/019
> > +++ b/tests/generic/019
> > @@ -53,8 +53,10 @@ stop_fail_scratch_dev()
> >  # Override the default cleanup function.
> >  _cleanup()
> >  {
> > -    disallow_fail_make_request
> > -    rm -f $tmp.*
> > +	kill $fs_pid $fio_pid &> /dev/null
> > +	disallow_fail_make_request
> > +	cd /
> > +	rm -r -f $tmp.*
> >  }
> >  
> >  RUN_TIME=$((20+10*$TIME_FACTOR))
> 
> Might be worth unset'ing the "fs_pid" and "fio_pid" variables after the
> wait, but should be fine as-is:

I agree. Better to avoid killing other system processes. Or how about this place
does (avoid killing system useful processes):
$KILLALL_PROG -q $FSSTRESS_PROG
$KILLALL_PROG -q $FIO_PROG

Another picky question is, do we need to use a while loop checking, until the
processes really get killed? :)

Thanks,
Zorro

> Reviewed-by: David Disseldorp <ddiss@xxxxxxx>
> 
> Cheers, David
> 




[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