diff mbox series

[09/24] xfs/070: add scratch log device options to direct repair invocation

Message ID 160013423329.2923511.3252823001209034556.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series fstests: tons of random fixes | expand

Commit Message

Darrick J. Wong Sept. 15, 2020, 1:43 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/070 |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Zorro Lang Sept. 16, 2020, 2:42 a.m. UTC | #1
On Mon, Sep 14, 2020 at 06:43:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/xfs/070 |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/tests/xfs/070 b/tests/xfs/070
> index 5d52a830..313864b7 100755
> --- a/tests/xfs/070
> +++ b/tests/xfs/070
> @@ -41,9 +41,11 @@ _cleanup()
>  _xfs_repair_noscan()
>  {
>  	# invoke repair directly so we can kill the process if need be
> +	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
> +		log_repair_opts="-l $SCRATCH_LOGDEV"
>  	[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
>  		rt_repair_opts="-r $SCRATCH_RTDEV"
> -	$XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 |
> +	$XFS_REPAIR_PROG $log_repair_opts $rt_repair_opts $SCRATCH_DEV 2>&1 |
>  		tee -a $seqres.full > $tmp.repair &

Why not use _scratch_xfs_repair at here?

Thanks,
Zorro

>  	repair_pid=$!
>  
>
Darrick J. Wong Sept. 16, 2020, 3:42 a.m. UTC | #2
On Wed, Sep 16, 2020 at 10:42:47AM +0800, Zorro Lang wrote:
> On Mon, Sep 14, 2020 at 06:43:53PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  tests/xfs/070 |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > 
> > diff --git a/tests/xfs/070 b/tests/xfs/070
> > index 5d52a830..313864b7 100755
> > --- a/tests/xfs/070
> > +++ b/tests/xfs/070
> > @@ -41,9 +41,11 @@ _cleanup()
> >  _xfs_repair_noscan()
> >  {
> >  	# invoke repair directly so we can kill the process if need be
> > +	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
> > +		log_repair_opts="-l $SCRATCH_LOGDEV"
> >  	[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
> >  		rt_repair_opts="-r $SCRATCH_RTDEV"
> > -	$XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 |
> > +	$XFS_REPAIR_PROG $log_repair_opts $rt_repair_opts $SCRATCH_DEV 2>&1 |
> >  		tee -a $seqres.full > $tmp.repair &
> 
> Why not use _scratch_xfs_repair at here?
> 
> Thanks,
> Zorro
> 
> >  	repair_pid=$!

        ^^^^^^^^^^^^^
Because this test needs to hang on to the pid of the repair process in
order to kill it, which you can't do if do if you use the wrapper.

--D

> >  
> > 
>
Zorro Lang Sept. 16, 2020, 11:25 a.m. UTC | #3
On Tue, Sep 15, 2020 at 08:42:01PM -0700, Darrick J. Wong wrote:
> On Wed, Sep 16, 2020 at 10:42:47AM +0800, Zorro Lang wrote:
> > On Mon, Sep 14, 2020 at 06:43:53PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <darrick.wong@oracle.com>
> > > 
> > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > > ---
> > >  tests/xfs/070 |    4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > 
> > > diff --git a/tests/xfs/070 b/tests/xfs/070
> > > index 5d52a830..313864b7 100755
> > > --- a/tests/xfs/070
> > > +++ b/tests/xfs/070
> > > @@ -41,9 +41,11 @@ _cleanup()
> > >  _xfs_repair_noscan()
> > >  {
> > >  	# invoke repair directly so we can kill the process if need be
> > > +	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
> > > +		log_repair_opts="-l $SCRATCH_LOGDEV"
> > >  	[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
> > >  		rt_repair_opts="-r $SCRATCH_RTDEV"
> > > -	$XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 |
> > > +	$XFS_REPAIR_PROG $log_repair_opts $rt_repair_opts $SCRATCH_DEV 2>&1 |
> > >  		tee -a $seqres.full > $tmp.repair &
> > 
> > Why not use _scratch_xfs_repair at here?
> > 
> > Thanks,
> > Zorro
> > 
> > >  	repair_pid=$!
> 
>         ^^^^^^^^^^^^^

Oh, right! That's good to me now.
Reviewed-by: Zorro Lang <zlang@redhat.com>

> Because this test needs to hang on to the pid of the repair process in
> order to kill it, which you can't do if do if you use the wrapper.
> 
> --D
> 
> > >  
> > > 
> > 
>
Christoph Hellwig Sept. 17, 2020, 7:55 a.m. UTC | #4
On Mon, Sep 14, 2020 at 06:43:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/tests/xfs/070 b/tests/xfs/070
index 5d52a830..313864b7 100755
--- a/tests/xfs/070
+++ b/tests/xfs/070
@@ -41,9 +41,11 @@  _cleanup()
 _xfs_repair_noscan()
 {
 	# invoke repair directly so we can kill the process if need be
+	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+		log_repair_opts="-l $SCRATCH_LOGDEV"
 	[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
 		rt_repair_opts="-r $SCRATCH_RTDEV"
-	$XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 |
+	$XFS_REPAIR_PROG $log_repair_opts $rt_repair_opts $SCRATCH_DEV 2>&1 |
 		tee -a $seqres.full > $tmp.repair &
 	repair_pid=$!