]> git.michaelhowe.org Git - packages/o/openafs.git/commit
salvager: prevent assertion during -orphans attach
authorMark Vitale <mvitale@sinenomine.net>
Fri, 25 Jan 2013 23:47:49 +0000 (18:47 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 18 Sep 2013 14:08:34 +0000 (07:08 -0700)
commit6e29c74fbd304e29b9d6309b4a79db17416fb081
tree931a5f79802f45a4fca78d5d7569e7c28e7e889a
parent2879ab9b26fd67bfa802b54bc4ac316a9448f1d1
salvager: prevent assertion during -orphans attach

Improve JudgeEntry() detection of orphaned directories to
prevent unintentional deletion of their '.' and '..' entries.
This in turn prevents a later assert (opr_Verify) when we try to
delete and re-add '..' in order to attach the orphan.

In JudgeEntry(), 2 sources of information about a
directory entry are compared for consistency:
 - vnodeEssence (unique) from its vnode index entry
 - name, vnodeNumber and unique from its dir blob entry

A directory entry may be ignored, deleted, or repaired/replaced,
based upon the results of these and other tests (e.g. dirOprhaned).

The '.' and '..' entries are treated as special cases because
we do not want to delete them at this point if this directory
is orphaned.  However, the current test for orphanhood
(vnodeEssence->unique == 0) is not sufficient; it could be
zero for other reasons.  This commit now uses the dirOrphaned
flag to test for this.

However, we are still interested in doing the right thing
for '.' and '..' entries with vnodeEssence->unique == 0.
This may indicate that the dir blob entry is pointing at the
wrong vnode, and that vnode has unique==0.  The current code
incorrectly ignores (returns 0) this case.  This commit now
now falls through to the repair/replace code so that we can
find the correct vnode for this entry.

The current code assumes that the 'vnodeEssence == 0 &&
!dirOrphaned' case doesn't exist.

Thanks to Andrew Deason for his assistance.

Reviewed-on: http://gerrit.openafs.org/9104
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit e8faeae6dcae0e566de2b21d53d3f78f3cc44e3f)

Change-Id: Ibc9e6ddf1f281e3a3a560ed1eefcdb4776e12caa
Reviewed-on: http://gerrit.openafs.org/10165
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vol-salvage.c