xfs
[Top] [All Lists]

[PATCH] xfstests: fix internal _xfs_check to handle logdev etc

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfstests: fix internal _xfs_check to handle logdev etc
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Thu, 02 May 2013 09:53:19 -0500
Cc: "Michael L. Semon" <mlsemon35@xxxxxxxxx>, Chandra Seetharaman <sekharan@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
Pull all of the old xfs_check script into common/rc:_xfs_check()
so that it properly handles all options, including external log
devices.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/common/rc b/common/rc
index 19a0e18..b47a53e 100644
--- a/common/rc
+++ b/common/rc
@@ -393,8 +393,8 @@ _xfs_check()
 {
     OPTS=" "
     DBOPTS=" "
+    USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-i ino]... [-b bno]... 
special"
 
-    OPTIND=1
     while getopts "b:fi:l:stvV" c
     do
         case $c in
@@ -410,8 +410,17 @@ _xfs_check()
                 ;;
         esac
     done
-    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
-    return $?
+    set -- extra $@
+    shift $OPTIND
+    case $# in
+        1)    ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
+               status=$?
+               ;;
+        2)    echo $USAGE 1>&1
+              status=2
+              ;;
+    esac
+    return $status
 }
 
 _setup_large_ext4_fs()



<Prev in Thread] Current Thread [Next in Thread>