diff mbox

xfstests: make "BTRFS_UTIL_PROG filesystem defragment" work

Message ID 1429002060-16597-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu Bo April 14, 2015, 9:01 a.m. UTC
_require_defrag() needs to check if the command is executable, but btrfs has
its subcommand "filesystem defragment", which makes this checking fail.

This workarounds it and now we can run case generic/324, generic/018, btrfs/005.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 common/defrag | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Filipe Manana April 14, 2015, 9:14 a.m. UTC | #1
On Tue, Apr 14, 2015 at 10:01 AM, Liu Bo <bo.li.liu@oracle.com> wrote:
> _require_defrag() needs to check if the command is executable, but btrfs has
> its subcommand "filesystem defragment", which makes this checking fail.
>
> This workarounds it and now we can run case generic/324, generic/018, btrfs/005.

There's already a patch from Zhao to fix the regression:

https://patchwork.kernel.org/patch/6205031/

thanks

>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  common/defrag | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/common/defrag b/common/defrag
> index f923dc0..f36a68b 100644
> --- a/common/defrag
> +++ b/common/defrag
> @@ -37,7 +37,11 @@ _require_defrag()
>         ;;
>      esac
>
> -    _require_command "$DEFRAG_PROG" defragment
> +    if [ "$FSTYP" == "btrfs" ]; then
> +           _require_command "$BTRFS_UTIL_PROG" defragment
> +    else
> +           _require_command "$DEFRAG_PROG" defragment
> +    fi
>      _require_xfs_io_command "fiemap"
>  }
>
> --
> 1.8.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Liu Bo April 14, 2015, 9:29 a.m. UTC | #2
On Tue, Apr 14, 2015 at 10:14:59AM +0100, Filipe David Manana wrote:
> On Tue, Apr 14, 2015 at 10:01 AM, Liu Bo <bo.li.liu@oracle.com> wrote:
> > _require_defrag() needs to check if the command is executable, but btrfs has
> > its subcommand "filesystem defragment", which makes this checking fail.
> >
> > This workarounds it and now we can run case generic/324, generic/018, btrfs/005.
> 
> There's already a patch from Zhao to fix the regression:
> 
> https://patchwork.kernel.org/patch/6205031/

Got it, thanks for pointing it out.

Thanks,

-liubo

> 
> thanks
> 
> >
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> > ---
> >  common/defrag | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/common/defrag b/common/defrag
> > index f923dc0..f36a68b 100644
> > --- a/common/defrag
> > +++ b/common/defrag
> > @@ -37,7 +37,11 @@ _require_defrag()
> >         ;;
> >      esac
> >
> > -    _require_command "$DEFRAG_PROG" defragment
> > +    if [ "$FSTYP" == "btrfs" ]; then
> > +           _require_command "$BTRFS_UTIL_PROG" defragment
> > +    else
> > +           _require_command "$DEFRAG_PROG" defragment
> > +    fi
> >      _require_xfs_io_command "fiemap"
> >  }
> >
> > --
> > 1.8.2.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe fstests" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> -- 
> Filipe David Manana,
> 
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/defrag b/common/defrag
index f923dc0..f36a68b 100644
--- a/common/defrag
+++ b/common/defrag
@@ -37,7 +37,11 @@  _require_defrag()
 	;;
     esac
 
-    _require_command "$DEFRAG_PROG" defragment
+    if [ "$FSTYP" == "btrfs" ]; then
+	    _require_command "$BTRFS_UTIL_PROG" defragment
+    else
+	    _require_command "$DEFRAG_PROG" defragment
+    fi
     _require_xfs_io_command "fiemap"
 }