summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-02-24 11:59:11 +1100
committerNeilBrown <neilb@suse.de>2010-02-24 11:59:11 +1100
commit097075b6111f46f87207b02bc3819280c39180f0 (patch)
tree1c8559bc7098648bf9bbcf4c5f17c806598ee68a
parent4c1c3ad8cf69763a4c8c4ba692a8cb93327a4abf (diff)
downloadmdadm-097075b6111f46f87207b02bc3819280c39180f0.tar.gz
mdadm-097075b6111f46f87207b02bc3819280c39180f0.tar.xz
mdadm-097075b6111f46f87207b02bc3819280c39180f0.zip
Grow: be more relaxed about timestamp mismatches on backup file.
As backup file has a timestamp which is updated quite separately from the metadata timestamp. They should be largely in-sync but sometimes are not. So be more generous in the check, and allow it to be over-ridden by an environment variable. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Grow.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/Grow.c b/Grow.c
index efa8c47..74b63b6 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1727,11 +1727,23 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
continue; /* Wrong uuid */
}
- if (info->array.utime > __le64_to_cpu(bsb.mtime) + 10*60 ||
+ /* array utime and backup-mtime should be updated at much the same time, but it seems that
+ * sometimes they aren't... So allow considerable flexability in matching, and allow
+ * this test to be overridden by an environment variable.
+ */
+ if (info->array.utime > __le64_to_cpu(bsb.mtime) + 2*60*60 ||
info->array.utime < __le64_to_cpu(bsb.mtime) - 10*60) {
- if (verbose)
- fprintf(stderr, Name ": too-old timestamp on backup-metadata on %s\n", devname);
- continue; /* time stamp is too bad */
+ if (check_env("MDADM_GROW_ALLOW_OLD")) {
+ fprintf(stderr, Name ": accepting backup with timestamp %lu "
+ "for array with timestamp %lu\n",
+ (unsigned long)__le64_to_cpu(bsb.mtime),
+ (unsigned long)info->array.utime);
+ } else {
+ if (verbose)
+ fprintf(stderr, Name ": too-old timestamp on "
+ "backup-metadata on %s\n", devname);
+ continue; /* time stamp is too bad */
+ }
}
if (bsb.magic[15] == '1') {