From 9a728fd86c7add13e15dfa0d3062fa94cc77c53f Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Tue, 8 May 2012 10:01:12 -0400 Subject: [PATCH] vos: convertROtoRW may create two RW volumes If the RW volume is listed after the RO convert target in the VLDB, the code failed to detect that an RW is already present and would create a second RW volume. Change-Id: Ia77004214c4d1b18699b5527bc1fc928e8e1143d Reviewed-on: http://gerrit.openafs.org/7385 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/volser/vos.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/volser/vos.c b/src/volser/vos.c index 0010a1bff9..89dbe9e446 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -5564,8 +5564,9 @@ ConvertRO(struct cmd_syndesc *as, void *arock) rwindex = i; rwserver = entry.serverNumber[i]; rwpartition = entry.serverPartition[i]; - } - if (entry.serverFlags[i] & ITSROVOL) { + if (roserver) + break; + } else if ((entry.serverFlags[i] & ITSROVOL) && !roserver) { same = VLDB_IsSameAddrs(server, entry.serverNumber[i], &code); if (code) { fprintf(STDERR, @@ -5577,7 +5578,8 @@ ConvertRO(struct cmd_syndesc *as, void *arock) roindex = i; roserver = entry.serverNumber[i]; ropartition = entry.serverPartition[i]; - break; + if (rwserver) + break; } } }