Michael Tokarev: do not check recently created arrays (#624273)
Michael Tokarev
mjt at alioth.debian.org
Fri May 25 18:01:41 UTC 2012
Module: mdadm
Branch: master
Commit: d8331bf5a9877522e320a9bbf99eaae0cc7153e9
URL: http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=d8331bf5a9877522e320a9bbf99eaae0cc7153e9
Author: Michael Tokarev <mjt at tls.msk.ru>
Date: Fri May 25 21:12:38 2012 +0400
do not check recently created arrays (#624273)
---
debian/changelog | 2 ++
debian/checkarray | 15 +++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f6f4a10..7359f9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ mdadm (3.2.5-1) UNRELEASED; urgency=low
device to an array, introduced in 3.2.4, plus other minor fixes
(Closes: #673104, #673344)
* new patch: sha1-includes.diff to fix #include mess in new sha1.h
+ * added a check into debian/checkarray to skip checking arrays created
+ less than 2 weeks ago (Closes: #624273)
-- Michael Tokarev <mjt at tls.msk.ru> Fri, 25 May 2012 20:23:52 +0400
diff --git a/debian/checkarray b/debian/checkarray
index 2043d8c..a3e5a6b 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
More information about the pkg-mdadm-commits
mailing list