r61 - mdadm/trunk/debian

madduck at users.alioth.debian.org madduck at users.alioth.debian.org
Wed Aug 2 15:17:45 UTC 2006


Author: madduck
Date: 2006-08-02 15:17:40 +0000 (Wed, 02 Aug 2006)
New Revision: 61

Modified:
   mdadm/trunk/debian/changelog
   mdadm/trunk/debian/checkarray
Log:
* checkarray: now supports -x|--cancel switch to cancel running checks.

Modified: mdadm/trunk/debian/changelog
===================================================================
--- mdadm/trunk/debian/changelog	2006-08-02 15:10:29 UTC (rev 60)
+++ mdadm/trunk/debian/changelog	2006-08-02 15:17:40 UTC (rev 61)
@@ -15,9 +15,10 @@
     checks, or when there are no redundant arrays present (closes: #380746).
   * checkarray: now supports -s|--status switch to query parity check status
     for given devices.
+  * checkarray: now supports -x|--cancel switch to cancel running checks.
   * mkconf: now also outputs MAILADDR.
 
- -- martin f. krafft <madduck at debian.org>  Wed,  2 Aug 2006 16:07:03 +0100
+ -- martin f. krafft <madduck at debian.org>  Wed,  2 Aug 2006 16:17:09 +0100
 
 mdadm (2.5.2-9) unstable; urgency=low
 

Modified: mdadm/trunk/debian/checkarray
===================================================================
--- mdadm/trunk/debian/checkarray	2006-08-02 15:10:29 UTC (rev 60)
+++ mdadm/trunk/debian/checkarray	2006-08-02 15:17:40 UTC (rev 61)
@@ -5,7 +5,7 @@
 # Copyright © 2006 martin f. krafft <madduck at debian.org>
 # distributed under the terms of the Artistic Licence.
 #
-REVISION=2006.08.02.1604
+REVISION=2006.08.02.1620
 
 PROGNAME=${0##*/}
 
@@ -45,8 +45,8 @@
   echo "You can also control the status of a check with /proc/mdstat ."
 }
 
-SHORTOPTS=achVqQs
-LONGOPTS=all,cron,help,version,quiet,real-quiet,status
+SHORTOPTS=achVqQsx
+LONGOPTS=all,cron,help,version,quiet,real-quiet,status,cancel
 
 eval set -- $(getopt -o $SHORTOPTS -l $LONGOPTS -n $PROGNAME -- "$@")
 
@@ -55,12 +55,14 @@
 all=0
 quiet=0
 status=0
+action=check
 
 for opt in $@; do
   case "$opt" in
     -a|--all) all=1;;
     -c|--cron) cron=1;;
-    -s|--status) status=1;;
+    -s|--status) action=status;;
+    -x|--cancel) action=idle;;
     -h|--help) usage; exit 0;;
     -q|--quiet) quiet=1;;
     -Q|--real-quiet) quiet=2;;
@@ -131,7 +133,7 @@
 
   cur_status="$(cat $SYNC_ACTION_CTL)"
 
-  if [ $status -eq 1 ]; then
+  if [ $action = status ]; then
     echo "$array: $cur_status"
     continue
   fi
@@ -141,16 +143,25 @@
     exit 4
   fi
 
-  if [ "$cur_status" != idle ]; then
-    [ $quiet -lt 2 ] && echo "$PROGNAME: W: array $array not idle, skipping..." >&2
-    continue
-  fi
+  case "$action" in
+    idle)
+      echo $action > $SYNC_ACTION_CTL
+      [ $quiet -lt 1 ] && echo "$PROGNAME: I: cancel request queued for array $array." >&2
+      ;;
 
-  # run check for the array. The kernel will make sure that these requests
-  # are properly queued so as to not kill one of the array.
-  echo check > $SYNC_ACTION_CTL
-  [ $quiet -lt 1 ] && echo "$PROGNAME: I: check queued for array $array." >&2
-  
+    check)
+      if [ "$cur_status" != idle ]; then
+        [ $quiet -lt 2 ] && echo "$PROGNAME: W: array $array not idle, skipping..." >&2
+        continue
+      fi
+
+      # queue request for the array. The kernel will make sure that these requests
+      # are properly queued so as to not kill one of the array.
+      echo $action > $SYNC_ACTION_CTL
+      [ $quiet -lt 1 ] && echo "$PROGNAME: I: check queued for array $array." >&2
+      ;;
+  esac
+
 done
 
 exit 0




More information about the pkg-mdadm-commits mailing list