summaryrefslogtreecommitdiff
path: root/debian/checkarray
diff options
context:
space:
mode:
authorMichael Tokarev <mjt@tls.msk.ru>2012-05-25 21:12:38 +0400
committerMichael Tokarev <mjt@tls.msk.ru>2012-05-25 21:12:38 +0400
commitd8331bf5a9877522e320a9bbf99eaae0cc7153e9 (patch)
tree50a63d6a855e571e80dd202f904db9e1085e4ad7 /debian/checkarray
parent8fbf562ad451080db4fc493ca5807c3f35afd2e1 (diff)
do not check recently created arrays (#624273)
Diffstat (limited to 'debian/checkarray')
-rw-r--r--debian/checkarray15
1 files changed, 15 insertions, 0 deletions
diff --git a/debian/checkarray b/debian/checkarray
index 2043d8cd..a3e5a6be 100644
--- a/debian/checkarray
+++ b/debian/checkarray
@@ -175,6 +175,21 @@ for array in $arrays; do
continue
fi
+ # check if the array created recently and skip test if it is
+ created=$(mdadm --detail /dev/$array 2>/dev/null |
+ sed -n 's/.*Creation Time *://p' )
+ if [ -n "$created" ]; then
+ created=$(date +%s -d "$created" 2>/dev/null)
+ fi
+ if [ -n "$created" ]; then
+ now=$(date +%s)
+ if [ "$created" -lt "$now" -a \
+ "$created" -gt "$(($now - 14 * 24 * 60 * 60))" ]; then
+ [ $quiet -lt 2 ] && echo "$PROGNAME: I: array $array created recently, skipping..." >&2
+ continue
+ fi
+ 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 > $MDBASE/sync_action