public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: fix internal _xfs_check to handle logdev etc
@ 2013-05-02 14:53 Eric Sandeen
  2013-05-02 15:38 ` Chandra Seetharaman
  2013-05-03 16:09 ` Rich Johnston
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Sandeen @ 2013-05-02 14:53 UTC (permalink / raw)
  To: xfs-oss; +Cc: Michael L. Semon, Chandra Seetharaman

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@redhat.com>
---

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()



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

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

end of thread, other threads:[~2013-05-03 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 14:53 [PATCH] xfstests: fix internal _xfs_check to handle logdev etc Eric Sandeen
2013-05-02 15:38 ` Chandra Seetharaman
2013-05-02 16:08   ` Eric Sandeen
2013-05-02 17:44     ` Chandra Seetharaman
2013-05-02 18:31       ` Eric Sandeen
2013-05-02 20:35         ` Michael L. Semon
2013-05-02 20:48           ` Eric Sandeen
2013-05-02 21:54             ` Michael L. Semon
2013-05-02 21:58               ` Eric Sandeen
2013-05-03 16:09 ` Rich Johnston

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