Read volume at correct address when looking for broken forward links.
authorRod Widdowson <rdw@steadingsoftware.com>
Tue, 18 May 2010 13:48:38 +0000 (14:48 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sun, 23 May 2010 14:25:39 +0000 (07:25 -0700)
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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vlserver/vldb_check.c

index 43c37d2..9ce3747 100644 (file)
@@ -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,