Correct duplicate special inodes while salvaging
authorAndrew Deason <adeason@sinenomine.net>
Mon, 26 Oct 2009 19:09:41 +0000 (14:09 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 30 Nov 2009 17:00:45 +0000 (09:00 -0800)
commitd393aabca577917b107afdd42efb40cc2fdac50c
tree231d4fd7875c03fd8edb9f859918b1760dc16dd2
parent19f0da1e44c6ac5acd22f8a2b1d9095d568d216e
Correct duplicate special inodes while salvaging

Right now when the salvager encounters duplicate special inodes for a
volume, it refuses to salvage the volume, presumably because it does not
know which inodes to use when recreating the volume header.

However, this can cause the confusing state where the fileserver and
various volume utilities have no problem with a volume, but the salvager
refuses to salvage it and marks the volume as needing salvage. When
salvaging, if we already have a volume header, and we encounter
duplicate special inodes, it is likely that the special inode referenced
by the volume header is the correct one.

So, instead of erroring out, keep track of which inodes are referenced
in the volume header, and if there are any duplicates, either ignore or
delete the unreferenced ones, depending on the -orphans setting. Also be
a little more verbose when logging errors in this area.

Change-Id: I15e34e8f2bccdc666bb59e3730fdf8bf51624259
Reviewed-on: http://gerrit.openafs.org/736
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Steve Simmons <scs@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/vol-salvage.c