public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: Remove dependence of xfs_check script
@ 2013-04-17 19:17 Chandra Seetharaman
  2013-04-17 21:34 ` Eric Sandeen
  0 siblings, 1 reply; 6+ messages in thread
From: Chandra Seetharaman @ 2013-04-17 19:17 UTC (permalink / raw)
  To: XFS mailing list

Replace the usage of the script xfs_check and add the relevant code to
xfstests.

This is in preparation of the planned deprecation of xfs_check.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
diff --git a/common/config b/common/config
index bf62996..dfbb5c2 100644
--- a/common/config
+++ b/common/config
@@ -154,7 +154,6 @@ export DF_PROG="`set_prog_path df`"
 
 export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
 export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
-export XFS_CHECK_PROG="`set_prog_path xfs_check`"
 export XFS_DB_PROG="`set_prog_path xfs_db`"
 export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
 export XFS_IO_PROG="`set_prog_path xfs_io`"
diff --git a/common/rc b/common/rc
index 09fb83f..9cea3f9 100644
--- a/common/rc
+++ b/common/rc
@@ -166,7 +166,6 @@ case "$FSTYP" in
     xfs)
 	 [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
 	 [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
-	 [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
 	 [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
 	 [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
 	 ;;
@@ -387,6 +386,31 @@ _scratch_mkfs_xfs()
     return $mkfs_status
 }
 
+_xfs_check()
+{
+    OPTS=" "
+    DBOPTS=" "
+
+    OPTIND=1
+    while getopts "b:fi:l:stvV" c
+    do
+        case $c in
+            s) OPTS=$OPTS"-s ";;
+            t) OPTS=$OPTS"-t ";;
+            v) OPTS=$OPTS"-v ";;
+            i) OPTS=$OPTS"-i "$OPTARG" ";;
+            b) OPTS=$OPTS"-b "$OPTARG" ";;
+            f) DBOPTS=$DBOPTS" -f";;
+            l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
+            V) $XFS_DB_PROG -p xfs_check -V
+                return $?
+                ;;
+        esac
+    done
+    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
+    return $?
+}
+
 _setup_large_ext4_fs()
 {
 	fs_size=$1
@@ -589,7 +613,7 @@ _scratch_xfs_check()
         SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
     [ "$LARGE_SCRATCH_DEV" = yes ] && \
         SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
-    $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
+    _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
 }
 
 _scratch_xfs_repair()
@@ -1426,7 +1450,7 @@ _check_xfs_filesystem()
     # option (-t) to avoid indexing the free space trees doesn't make it pass on
     # large filesystems. Avoid it.
     if [ "$LARGE_SCRATCH_DEV" != yes ]; then
-	    $XFS_CHECK_PROG $extra_log_options $device 2>&1 |\
+	    _xfs_check $extra_log_options $device 2>&1 |\
 		 _fix_malloc >$tmp.fs_check
     fi
     if [ -s $tmp.fs_check ]
diff --git a/crash/xfscrash b/crash/xfscrash
index 7831d7e..579b724 100755
--- a/crash/xfscrash
+++ b/crash/xfscrash
@@ -120,11 +120,11 @@ _check()
     if [ $expect -eq 0 ]
     then
         _echo "      *** xfs_check ($LOG/check_clean.out)"   
-        xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
+        _xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
         [ -s /tmp/xfs_check_clean.out ] && fail=1
     else
         _echo "      *** xfs_check ($LOG/check_dirty.out)"   
-        xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
+        _xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
     fi
     
     if [ $fail -eq 0 -a $expect -eq 0 ]
diff --git a/tests/xfs/085 b/tests/xfs/085
index 27f29a3..af71b77 100755
--- a/tests/xfs/085
+++ b/tests/xfs/085
@@ -70,7 +70,7 @@ _print_logstate
 
 # curious if FS consistent at start
 if false; then
-    if $XFS_CHECK_PROG $SCRATCH_DEV; then
+    if _xfs_check $SCRATCH_DEV; then
        echo "*** checked ok ***"
     fi
 fi
diff --git a/tests/xfs/291 b/tests/xfs/291
old mode 100644
new mode 100755
index f842679..7723b9e
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -113,7 +113,7 @@ done
 _scratch_unmount
 # Can xfs_repair and xfs_check cope with this monster?
 _scratch_xfs_repair >> $seqres.full 2>&1 || _fail "xfs_repair failed"
-xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
+_xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
 
 # Yes they can!  Now...
 # Can xfs_metadump cope with this monster?


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: Remove dependence of xfs_check script
  2013-04-17 19:17 [PATCH] xfstests: Remove dependence of xfs_check script Chandra Seetharaman
@ 2013-04-17 21:34 ` Eric Sandeen
  2013-04-18 15:12   ` Chandra Seetharaman
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2013-04-17 21:34 UTC (permalink / raw)
  To: sekharan; +Cc: XFS mailing list

On 4/17/13 12:17 PM, Chandra Seetharaman wrote:
> Replace the usage of the script xfs_check and add the relevant code to
> xfstests.
> 
> This is in preparation of the planned deprecation of xfs_check.

Other than maybe having a comment about why _xfs_check() is embedded
in common/rc for future readers, this looks fine to me, thanks.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> ---
> diff --git a/common/config b/common/config
> index bf62996..dfbb5c2 100644
> --- a/common/config
> +++ b/common/config
> @@ -154,7 +154,6 @@ export DF_PROG="`set_prog_path df`"
>  
>  export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
>  export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
> -export XFS_CHECK_PROG="`set_prog_path xfs_check`"
>  export XFS_DB_PROG="`set_prog_path xfs_db`"
>  export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
>  export XFS_IO_PROG="`set_prog_path xfs_io`"
> diff --git a/common/rc b/common/rc
> index 09fb83f..9cea3f9 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -166,7 +166,6 @@ case "$FSTYP" in
>      xfs)
>  	 [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
>  	 [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
> -	 [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
>  	 [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
>  	 [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
>  	 ;;
> @@ -387,6 +386,31 @@ _scratch_mkfs_xfs()
>      return $mkfs_status
>  }
>  
> +_xfs_check()
> +{
> +    OPTS=" "
> +    DBOPTS=" "
> +
> +    OPTIND=1
> +    while getopts "b:fi:l:stvV" c
> +    do
> +        case $c in
> +            s) OPTS=$OPTS"-s ";;
> +            t) OPTS=$OPTS"-t ";;
> +            v) OPTS=$OPTS"-v ";;
> +            i) OPTS=$OPTS"-i "$OPTARG" ";;
> +            b) OPTS=$OPTS"-b "$OPTARG" ";;
> +            f) DBOPTS=$DBOPTS" -f";;
> +            l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
> +            V) $XFS_DB_PROG -p xfs_check -V
> +                return $?
> +                ;;
> +        esac
> +    done
> +    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
> +    return $?
> +}
> +
>  _setup_large_ext4_fs()
>  {
>  	fs_size=$1
> @@ -589,7 +613,7 @@ _scratch_xfs_check()
>          SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
>      [ "$LARGE_SCRATCH_DEV" = yes ] && \
>          SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
> -    $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
> +    _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
>  }
>  
>  _scratch_xfs_repair()
> @@ -1426,7 +1450,7 @@ _check_xfs_filesystem()
>      # option (-t) to avoid indexing the free space trees doesn't make it pass on
>      # large filesystems. Avoid it.
>      if [ "$LARGE_SCRATCH_DEV" != yes ]; then
> -	    $XFS_CHECK_PROG $extra_log_options $device 2>&1 |\
> +	    _xfs_check $extra_log_options $device 2>&1 |\
>  		 _fix_malloc >$tmp.fs_check
>      fi
>      if [ -s $tmp.fs_check ]
> diff --git a/crash/xfscrash b/crash/xfscrash
> index 7831d7e..579b724 100755
> --- a/crash/xfscrash
> +++ b/crash/xfscrash
> @@ -120,11 +120,11 @@ _check()
>      if [ $expect -eq 0 ]
>      then
>          _echo "      *** xfs_check ($LOG/check_clean.out)"   
> -        xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
> +        _xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
>          [ -s /tmp/xfs_check_clean.out ] && fail=1
>      else
>          _echo "      *** xfs_check ($LOG/check_dirty.out)"   
> -        xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
> +        _xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
>      fi
>      
>      if [ $fail -eq 0 -a $expect -eq 0 ]
> diff --git a/tests/xfs/085 b/tests/xfs/085
> index 27f29a3..af71b77 100755
> --- a/tests/xfs/085
> +++ b/tests/xfs/085
> @@ -70,7 +70,7 @@ _print_logstate
>  
>  # curious if FS consistent at start
>  if false; then
> -    if $XFS_CHECK_PROG $SCRATCH_DEV; then
> +    if _xfs_check $SCRATCH_DEV; then
>         echo "*** checked ok ***"
>      fi
>  fi
> diff --git a/tests/xfs/291 b/tests/xfs/291
> old mode 100644
> new mode 100755
> index f842679..7723b9e
> --- a/tests/xfs/291
> +++ b/tests/xfs/291
> @@ -113,7 +113,7 @@ done
>  _scratch_unmount
>  # Can xfs_repair and xfs_check cope with this monster?
>  _scratch_xfs_repair >> $seqres.full 2>&1 || _fail "xfs_repair failed"
> -xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
> +_xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
>  
>  # Yes they can!  Now...
>  # Can xfs_metadump cope with this monster?
> 
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: Remove dependence of xfs_check script
  2013-04-17 21:34 ` Eric Sandeen
@ 2013-04-18 15:12   ` Chandra Seetharaman
  2013-04-18 16:30     ` Eric Sandeen
  0 siblings, 1 reply; 6+ messages in thread
From: Chandra Seetharaman @ 2013-04-18 15:12 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: XFS mailing list

Thanks Eric.

Adding this above _xfs_check() in common/config sounds good ?

# xfs_check script is planned to be deprecated. But, we want to
# be able to invoke "xfs_check" behavior in xfstests in order to
# maintain the current verification levels. 

  
On Wed, 2013-04-17 at 14:34 -0700, Eric Sandeen wrote:
> On 4/17/13 12:17 PM, Chandra Seetharaman wrote:
> > Replace the usage of the script xfs_check and add the relevant code to
> > xfstests.
> > 
> > This is in preparation of the planned deprecation of xfs_check.
> 
> Other than maybe having a comment about why _xfs_check() is embedded
> in common/rc for future readers, this looks fine to me, thanks.
> 
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> 
> > Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> > ---
> > diff --git a/common/config b/common/config
> > index bf62996..dfbb5c2 100644
> > --- a/common/config
> > +++ b/common/config
> > @@ -154,7 +154,6 @@ export DF_PROG="`set_prog_path df`"
> >  
> >  export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
> >  export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
> > -export XFS_CHECK_PROG="`set_prog_path xfs_check`"
> >  export XFS_DB_PROG="`set_prog_path xfs_db`"
> >  export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
> >  export XFS_IO_PROG="`set_prog_path xfs_io`"
> > diff --git a/common/rc b/common/rc
> > index 09fb83f..9cea3f9 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -166,7 +166,6 @@ case "$FSTYP" in
> >      xfs)
> >  	 [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
> >  	 [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
> > -	 [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
> >  	 [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
> >  	 [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
> >  	 ;;
> > @@ -387,6 +386,31 @@ _scratch_mkfs_xfs()
> >      return $mkfs_status
> >  }
> >  
> > +_xfs_check()
> > +{
> > +    OPTS=" "
> > +    DBOPTS=" "
> > +
> > +    OPTIND=1
> > +    while getopts "b:fi:l:stvV" c
> > +    do
> > +        case $c in
> > +            s) OPTS=$OPTS"-s ";;
> > +            t) OPTS=$OPTS"-t ";;
> > +            v) OPTS=$OPTS"-v ";;
> > +            i) OPTS=$OPTS"-i "$OPTARG" ";;
> > +            b) OPTS=$OPTS"-b "$OPTARG" ";;
> > +            f) DBOPTS=$DBOPTS" -f";;
> > +            l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
> > +            V) $XFS_DB_PROG -p xfs_check -V
> > +                return $?
> > +                ;;
> > +        esac
> > +    done
> > +    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
> > +    return $?
> > +}
> > +
> >  _setup_large_ext4_fs()
> >  {
> >  	fs_size=$1
> > @@ -589,7 +613,7 @@ _scratch_xfs_check()
> >          SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
> >      [ "$LARGE_SCRATCH_DEV" = yes ] && \
> >          SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
> > -    $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
> > +    _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
> >  }
> >  
> >  _scratch_xfs_repair()
> > @@ -1426,7 +1450,7 @@ _check_xfs_filesystem()
> >      # option (-t) to avoid indexing the free space trees doesn't make it pass on
> >      # large filesystems. Avoid it.
> >      if [ "$LARGE_SCRATCH_DEV" != yes ]; then
> > -	    $XFS_CHECK_PROG $extra_log_options $device 2>&1 |\
> > +	    _xfs_check $extra_log_options $device 2>&1 |\
> >  		 _fix_malloc >$tmp.fs_check
> >      fi
> >      if [ -s $tmp.fs_check ]
> > diff --git a/crash/xfscrash b/crash/xfscrash
> > index 7831d7e..579b724 100755
> > --- a/crash/xfscrash
> > +++ b/crash/xfscrash
> > @@ -120,11 +120,11 @@ _check()
> >      if [ $expect -eq 0 ]
> >      then
> >          _echo "      *** xfs_check ($LOG/check_clean.out)"   
> > -        xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
> > +        _xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
> >          [ -s /tmp/xfs_check_clean.out ] && fail=1
> >      else
> >          _echo "      *** xfs_check ($LOG/check_dirty.out)"   
> > -        xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
> > +        _xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
> >      fi
> >      
> >      if [ $fail -eq 0 -a $expect -eq 0 ]
> > diff --git a/tests/xfs/085 b/tests/xfs/085
> > index 27f29a3..af71b77 100755
> > --- a/tests/xfs/085
> > +++ b/tests/xfs/085
> > @@ -70,7 +70,7 @@ _print_logstate
> >  
> >  # curious if FS consistent at start
> >  if false; then
> > -    if $XFS_CHECK_PROG $SCRATCH_DEV; then
> > +    if _xfs_check $SCRATCH_DEV; then
> >         echo "*** checked ok ***"
> >      fi
> >  fi
> > diff --git a/tests/xfs/291 b/tests/xfs/291
> > old mode 100644
> > new mode 100755
> > index f842679..7723b9e
> > --- a/tests/xfs/291
> > +++ b/tests/xfs/291
> > @@ -113,7 +113,7 @@ done
> >  _scratch_unmount
> >  # Can xfs_repair and xfs_check cope with this monster?
> >  _scratch_xfs_repair >> $seqres.full 2>&1 || _fail "xfs_repair failed"
> > -xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
> > +_xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
> >  
> >  # Yes they can!  Now...
> >  # Can xfs_metadump cope with this monster?
> > 
> > 
> > _______________________________________________
> > xfs mailing list
> > xfs@oss.sgi.com
> > http://oss.sgi.com/mailman/listinfo/xfs
> > 
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: Remove dependence of xfs_check script
  2013-04-18 15:12   ` Chandra Seetharaman
@ 2013-04-18 16:30     ` Eric Sandeen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2013-04-18 16:30 UTC (permalink / raw)
  To: sekharan@us.ibm.com; +Cc: XFS mailing list

On Apr 18, 2013, at 8:12 AM, Chandra Seetharaman <sekharan@us.ibm.com> wrote:

> Thanks Eric.
> 
> Adding this above _xfs_check() in common/config sounds good ?
> 
> # xfs_check script is planned to be deprecated. But, we want to
> # be able to invoke "xfs_check" behavior in xfstests in order to
> # maintain the current verification levels. 
> 
Sure, that's perfect.

Thanks,
Eric

> 
> On Wed, 2013-04-17 at 14:34 -0700, Eric Sandeen wrote:
>> On 4/17/13 12:17 PM, Chandra Seetharaman wrote:
>>> Replace the usage of the script xfs_check and add the relevant code to
>>> xfstests.
>>> 
>>> This is in preparation of the planned deprecation of xfs_check.
>> 
>> Other than maybe having a comment about why _xfs_check() is embedded
>> in common/rc for future readers, this looks fine to me, thanks.
>> 
>> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
>> 
>>> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
>>> ---
>>> diff --git a/common/config b/common/config
>>> index bf62996..dfbb5c2 100644
>>> --- a/common/config
>>> +++ b/common/config
>>> @@ -154,7 +154,6 @@ export DF_PROG="`set_prog_path df`"
>>> 
>>> export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
>>> export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
>>> -export XFS_CHECK_PROG="`set_prog_path xfs_check`"
>>> export XFS_DB_PROG="`set_prog_path xfs_db`"
>>> export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
>>> export XFS_IO_PROG="`set_prog_path xfs_io`"
>>> diff --git a/common/rc b/common/rc
>>> index 09fb83f..9cea3f9 100644
>>> --- a/common/rc
>>> +++ b/common/rc
>>> @@ -166,7 +166,6 @@ case "$FSTYP" in
>>>     xfs)
>>>     [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
>>>     [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
>>> -     [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
>>>     [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
>>>     [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
>>>     ;;
>>> @@ -387,6 +386,31 @@ _scratch_mkfs_xfs()
>>>     return $mkfs_status
>>> }
>>> 
>>> +_xfs_check()
>>> +{
>>> +    OPTS=" "
>>> +    DBOPTS=" "
>>> +
>>> +    OPTIND=1
>>> +    while getopts "b:fi:l:stvV" c
>>> +    do
>>> +        case $c in
>>> +            s) OPTS=$OPTS"-s ";;
>>> +            t) OPTS=$OPTS"-t ";;
>>> +            v) OPTS=$OPTS"-v ";;
>>> +            i) OPTS=$OPTS"-i "$OPTARG" ";;
>>> +            b) OPTS=$OPTS"-b "$OPTARG" ";;
>>> +            f) DBOPTS=$DBOPTS" -f";;
>>> +            l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
>>> +            V) $XFS_DB_PROG -p xfs_check -V
>>> +                return $?
>>> +                ;;
>>> +        esac
>>> +    done
>>> +    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
>>> +    return $?
>>> +}
>>> +
>>> _setup_large_ext4_fs()
>>> {
>>>    fs_size=$1
>>> @@ -589,7 +613,7 @@ _scratch_xfs_check()
>>>         SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
>>>     [ "$LARGE_SCRATCH_DEV" = yes ] && \
>>>         SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
>>> -    $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
>>> +    _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
>>> }
>>> 
>>> _scratch_xfs_repair()
>>> @@ -1426,7 +1450,7 @@ _check_xfs_filesystem()
>>>     # option (-t) to avoid indexing the free space trees doesn't make it pass on
>>>     # large filesystems. Avoid it.
>>>     if [ "$LARGE_SCRATCH_DEV" != yes ]; then
>>> -        $XFS_CHECK_PROG $extra_log_options $device 2>&1 |\
>>> +        _xfs_check $extra_log_options $device 2>&1 |\
>>>         _fix_malloc >$tmp.fs_check
>>>     fi
>>>     if [ -s $tmp.fs_check ]
>>> diff --git a/crash/xfscrash b/crash/xfscrash
>>> index 7831d7e..579b724 100755
>>> --- a/crash/xfscrash
>>> +++ b/crash/xfscrash
>>> @@ -120,11 +120,11 @@ _check()
>>>     if [ $expect -eq 0 ]
>>>     then
>>>         _echo "      *** xfs_check ($LOG/check_clean.out)"   
>>> -        xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
>>> +        _xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
>>>         [ -s /tmp/xfs_check_clean.out ] && fail=1
>>>     else
>>>         _echo "      *** xfs_check ($LOG/check_dirty.out)"   
>>> -        xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
>>> +        _xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
>>>     fi
>>> 
>>>     if [ $fail -eq 0 -a $expect -eq 0 ]
>>> diff --git a/tests/xfs/085 b/tests/xfs/085
>>> index 27f29a3..af71b77 100755
>>> --- a/tests/xfs/085
>>> +++ b/tests/xfs/085
>>> @@ -70,7 +70,7 @@ _print_logstate
>>> 
>>> # curious if FS consistent at start
>>> if false; then
>>> -    if $XFS_CHECK_PROG $SCRATCH_DEV; then
>>> +    if _xfs_check $SCRATCH_DEV; then
>>>        echo "*** checked ok ***"
>>>     fi
>>> fi
>>> diff --git a/tests/xfs/291 b/tests/xfs/291
>>> old mode 100644
>>> new mode 100755
>>> index f842679..7723b9e
>>> --- a/tests/xfs/291
>>> +++ b/tests/xfs/291
>>> @@ -113,7 +113,7 @@ done
>>> _scratch_unmount
>>> # Can xfs_repair and xfs_check cope with this monster?
>>> _scratch_xfs_repair >> $seqres.full 2>&1 || _fail "xfs_repair failed"
>>> -xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
>>> +_xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
>>> 
>>> # Yes they can!  Now...
>>> # Can xfs_metadump cope with this monster?
>>> 
>>> 
>>> _______________________________________________
>>> xfs mailing list
>>> xfs@oss.sgi.com
>>> http://oss.sgi.com/mailman/listinfo/xfs
>> 
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
> 
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] xfstests: Remove dependence of xfs_check script
@ 2013-04-18 17:44 Chandra Seetharaman
  2013-04-19 12:18 ` Rich Johnston
  0 siblings, 1 reply; 6+ messages in thread
From: Chandra Seetharaman @ 2013-04-18 17:44 UTC (permalink / raw)
  To: XFS mailing list; +Cc: Eric Sandeen

Replace the usage of the script xfs_check and add the relevant code to
xfstests.

This is in preparation of the planned deprecation of xfs_check.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common/config b/common/config
index bf62996..dfbb5c2 100644
--- a/common/config
+++ b/common/config
@@ -154,7 +154,6 @@ export DF_PROG="`set_prog_path df`"
 
 export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
 export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
-export XFS_CHECK_PROG="`set_prog_path xfs_check`"
 export XFS_DB_PROG="`set_prog_path xfs_db`"
 export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
 export XFS_IO_PROG="`set_prog_path xfs_io`"
diff --git a/common/rc b/common/rc
index 09fb83f..2397795 100644
--- a/common/rc
+++ b/common/rc
@@ -166,7 +166,6 @@ case "$FSTYP" in
     xfs)
 	 [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
 	 [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
-	 [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
 	 [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
 	 [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
 	 ;;
@@ -387,6 +386,34 @@ _scratch_mkfs_xfs()
     return $mkfs_status
 }
 
+# xfs_check script is planned to be deprecated. But, we want to
+# be able to invoke "xfs_check" behavior in xfstests in order to
+# maintain the current verification levels. 
+_xfs_check()
+{
+    OPTS=" "
+    DBOPTS=" "
+
+    OPTIND=1
+    while getopts "b:fi:l:stvV" c
+    do
+        case $c in
+            s) OPTS=$OPTS"-s ";;
+            t) OPTS=$OPTS"-t ";;
+            v) OPTS=$OPTS"-v ";;
+            i) OPTS=$OPTS"-i "$OPTARG" ";;
+            b) OPTS=$OPTS"-b "$OPTARG" ";;
+            f) DBOPTS=$DBOPTS" -f";;
+            l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
+            V) $XFS_DB_PROG -p xfs_check -V
+                return $?
+                ;;
+        esac
+    done
+    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
+    return $?
+}
+
 _setup_large_ext4_fs()
 {
 	fs_size=$1
@@ -589,7 +616,7 @@ _scratch_xfs_check()
         SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
     [ "$LARGE_SCRATCH_DEV" = yes ] && \
         SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
-    $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
+    _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
 }
 
 _scratch_xfs_repair()
@@ -1426,7 +1453,7 @@ _check_xfs_filesystem()
     # option (-t) to avoid indexing the free space trees doesn't make it pass on
     # large filesystems. Avoid it.
     if [ "$LARGE_SCRATCH_DEV" != yes ]; then
-	    $XFS_CHECK_PROG $extra_log_options $device 2>&1 |\
+	    _xfs_check $extra_log_options $device 2>&1 |\
 		 _fix_malloc >$tmp.fs_check
     fi
     if [ -s $tmp.fs_check ]
diff --git a/crash/xfscrash b/crash/xfscrash
index 7831d7e..579b724 100755
--- a/crash/xfscrash
+++ b/crash/xfscrash
@@ -120,11 +120,11 @@ _check()
     if [ $expect -eq 0 ]
     then
         _echo "      *** xfs_check ($LOG/check_clean.out)"   
-        xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
+        _xfs_check $TEST_DEV &> $LOG/check_clean.out || fail=1
         [ -s /tmp/xfs_check_clean.out ] && fail=1
     else
         _echo "      *** xfs_check ($LOG/check_dirty.out)"   
-        xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
+        _xfs_check $TEST_DEV &> $LOG/check_dirty.out || fail=1
     fi
     
     if [ $fail -eq 0 -a $expect -eq 0 ]
diff --git a/tests/xfs/085 b/tests/xfs/085
index 27f29a3..af71b77 100755
--- a/tests/xfs/085
+++ b/tests/xfs/085
@@ -70,7 +70,7 @@ _print_logstate
 
 # curious if FS consistent at start
 if false; then
-    if $XFS_CHECK_PROG $SCRATCH_DEV; then
+    if _xfs_check $SCRATCH_DEV; then
        echo "*** checked ok ***"
     fi
 fi
diff --git a/tests/xfs/291 b/tests/xfs/291
old mode 100644
new mode 100755
index f842679..7723b9e
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -113,7 +113,7 @@ done
 _scratch_unmount
 # Can xfs_repair and xfs_check cope with this monster?
 _scratch_xfs_repair >> $seqres.full 2>&1 || _fail "xfs_repair failed"
-xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
+_xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
 
 # Yes they can!  Now...
 # Can xfs_metadump cope with this monster?


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: Remove dependence of xfs_check script
  2013-04-18 17:44 Chandra Seetharaman
@ 2013-04-19 12:18 ` Rich Johnston
  0 siblings, 0 replies; 6+ messages in thread
From: Rich Johnston @ 2013-04-19 12:18 UTC (permalink / raw)
  To: sekharan; +Cc: Eric Sandeen, XFS mailing list

Thanks for submitting this patch Chandra, it has been committed.

--Rich

commit 187bccd310dc253feaebd69df4ccdda21eee12d0
Author: Chandra Seetharaman <sekharan@us.ibm.com>
Date:   Thu Apr 18 17:44:02 2013 +0000

     xfstests: Remove dependence of xfs_check script

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-19 12:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 19:17 [PATCH] xfstests: Remove dependence of xfs_check script Chandra Seetharaman
2013-04-17 21:34 ` Eric Sandeen
2013-04-18 15:12   ` Chandra Seetharaman
2013-04-18 16:30     ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2013-04-18 17:44 Chandra Seetharaman
2013-04-19 12:18 ` Rich Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox