From 6e57f80a9005ab354ce7602b3ce0c7d7a0d239cb Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 22 Nov 2010 20:58:06 +1100 Subject: [PATCH] Incr/spare: make sure failure to identify metadata if handled gracefully. Signed-off-by: NeilBrown --- Incremental.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Incremental.c b/Incremental.c index 44e83ba..de7fa6f 100644 --- a/Incremental.c +++ b/Incremental.c @@ -820,6 +820,13 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, for(i=0; !st2 && superlist[i]; i++) st2 = superlist[i]->match_metadata_desc( sra->text_version); + if (!st2) { + if (verbose > 1) + fprintf(stderr, Name ": not adding %s to %s" + " as metadata not recognised.\n", + devname, mp->path); + goto next; + } } else st2 = st; get_dev_size(dfd, NULL, &devsize);