diff options
author | NeilBrown <neilb@suse.de> | 2009-03-10 16:28:22 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-10 16:28:22 +1100 |
commit | ecb02e31d5e29bda0d9d9c7ae073f8379c7558d5 (patch) | |
tree | 0a245a1f68eb86595162719ad185cbe2cbd08ac3 /Incremental.c | |
parent | bfb7ea78e49bd851ee9fb73cac813123cb78b1de (diff) | |
download | mdadm-ecb02e31d5e29bda0d9d9c7ae073f8379c7558d5.tar.gz |
Incremental: fix some handling of trustworthy.
1/ if homehost matches, then we need to set trustworthy to 'LOCAL'
2/ if we decide to set trustworthy to 'METADATA' because we have to
use the metadata version name, do that *after* we have checked if
we are going to assemble within a container, as inside the
container there could be different sources of names to use.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Incremental.c b/Incremental.c index e293999..f8a5d32 100644 --- a/Incremental.c +++ b/Incremental.c @@ -220,19 +220,8 @@ int Incremental(char *devname, int verbose, int runstop, else if (homehost == NULL || st->ss->match_home(st, homehost) != 1) trustworthy = FOREIGN; - name_to_use = strchr(info.name, ':'); - if (name_to_use) - name_to_use++; else - name_to_use = info.name; - - if ((!name_to_use || name_to_use[0] == 0) && - info.array.level == LEVEL_CONTAINER && - trustworthy == LOCAL) { - name_to_use = info.text_version; - trustworthy = METADATA; - } - + trustworthy = LOCAL; /* There are three possible sources for 'autof': command line, * ARRAY line in mdadm.conf, or CREATE line in mdadm.conf. @@ -251,6 +240,19 @@ int Incremental(char *devname, int verbose, int runstop, return Incremental_container(st, devname, verbose, runstop, autof, trustworthy); } + name_to_use = strchr(info.name, ':'); + if (name_to_use) + name_to_use++; + else + name_to_use = info.name; + + if ((!name_to_use || name_to_use[0] == 0) && + info.array.level == LEVEL_CONTAINER && + trustworthy == LOCAL) { + name_to_use = info.text_version; + trustworthy = METADATA; + } + /* 4/ Check if array exists. */ map_lock(&map); |