vldb_check: Check for volume lock inconsistencies 07/14307/8
authorMichael Meffie <mmeffie@sinenomine.net>
Mon, 17 Aug 2020 19:44:55 +0000 (15:44 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 27 Nov 2020 04:08:07 +0000 (23:08 -0500)
commit4c33820525af510a8a937289005e39d5b6683b19
tree636e596412d05ae99bd21d7bdfffea0c15a30f6d
parent6779e30d372b2cd5e7995da23ed5e2971124b79c
vldb_check: Check for volume lock inconsistencies

Verify the a lock timestamp is set if, and only if, a lock volume
operation flag is also set.

When running vldb_check with the -fix option, fix the inconsistent
entries by setting the lock timestamp to the current time if a lock flag
is set, or by setting the VLOP_DELETE flag if the lock timestamp is set
but no lock flags are set. (The VLOP_DELETE flag is the flag set by the
'vos lock command, and is shown in vos output as "delete/misc".)

Volume lock fields can be put into an inconsistent state, at least, by
interupted vos rename operations, due to bugs in vos rename. When the
volume lock timestamp and lock flags are in this inconsistent state, the
volume is locked, but that is not indicated by 'vos listvldb'. The
volume can be unlocked by issuing 'vos unlock'.

Change-Id: Idc4f821a9eb7675edd78a8547fdfe46e838b0c89
Reviewed-on: https://gerrit.openafs.org/14307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/vlserver/vldb_check.c