From dd7b9235e677f92d928f0db40afaab9a1c3ee580 Mon Sep 17 00:00:00 2001 From: Rod Widdowson Date: Tue, 18 May 2010 14:48:38 +0100 Subject: [PATCH] Read volume at correct address when looking for broken forward links. vldb_check was reading a volume at the index rather than the file offset to read the volume. This was giving rise to phantom warnings since the hash was usually 0. The possibility of a broken flink is determined in another manner which is why in normal case we are not flooded with warnings. At the same time make the error message slightly more coherent. Change-Id: I35f237772819f6418eb9f8d77e0902bca28c4134 Reviewed-on: http://gerrit.openafs.org/1983 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/vlserver/vldb_check.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vlserver/vldb_check.c b/src/vlserver/vldb_check.c index 43c37d2ec..9ce37478b 100644 --- a/src/vlserver/vldb_check.c +++ b/src/vlserver/vldb_check.c @@ -1222,7 +1222,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock) nextpp = &vlentry.nextNameHash; which = "name"; volidbuf[0]='\0'; - readentry(nextp, &vlentry2, &type); + readentry(vlentry.nextNameHash, &vlentry2, &type); nexthash = NameHash(vlentry2.name); if (hash != nexthash) foundbroken = 1; @@ -1235,7 +1235,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock) nextpp = &(vlentry.nextIdHash[0]); which = "RW"; sprintf(volidbuf, "id %u ", vlentry.volumeId[0]); - readentry(nextp, &vlentry2, &type); + readentry(vlentry.nextIdHash[0], &vlentry2, &type); nexthash = IdHash(vlentry2.volumeId[0]); if (hash != nexthash) foundbroken = 1; @@ -1248,7 +1248,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock) nextpp = &(vlentry.nextIdHash[1]); which = "RO"; sprintf(volidbuf, "id %u ", vlentry.volumeId[1]); - readentry(nextp, &vlentry2, &type); + readentry(vlentry.nextIdHash[1], &vlentry2, &type); nexthash = IdHash(vlentry2.volumeId[1]); if (hash != nexthash) foundbroken = 1; @@ -1261,14 +1261,14 @@ WorkerBee(struct cmd_syndesc *as, void *arock) nextpp = &(vlentry.nextIdHash[2]); which = "BK"; sprintf(volidbuf, "id %u ", vlentry.volumeId[2]); - readentry(nextp, &vlentry2, &type); + readentry(vlentry.nextIdHash[2], &vlentry2, &type); nexthash = IdHash(vlentry2.volumeId[2]); if (hash != nexthash) foundbroken = 1; } if (foundbroken) { - log_error(VLDB_CHECK_ERROR, "%d: Volume '%s' %s forward link in %s is broken (hash %d != %d)", i, + log_error(VLDB_CHECK_ERROR, "%d: Volume '%s' %s forward link in %s hash chain is broken (hash %d != %d)", i, vlentry.name, volidbuf, which, hash, nexthash); } else if (foundbad) { log_error(VLDB_CHECK_ERROR, "%d: Volume '%s' %snot found in %s hash %d", i, -- 2.39.5