vlserver: Warn when we cannot unhash deleted entry 82/13382/3
authorAndrew Deason <adeason@sinenomine.net>
Mon, 12 Nov 2018 21:01:18 +0000 (15:01 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 30 Oct 2020 01:20:08 +0000 (21:20 -0400)
commit3e3fce24da31a31ca9a3f4ad356c4e4eaf0ad897
treef727bf9f57807c177b88c3569188e7a212742619
parent48df3ac30210056ec046b48c28aee425b0690f92
vlserver: Warn when we cannot unhash deleted entry

If we are trying to delete an entry from the vldb, we fail with
VL_NOENT if we cannot find the given entry on one of its hash chains.
This is indicative of corruption in the vldb (since we have an entry
not on a hash chain), but we don't really indicate this clearly. There
are no log messages, and the user running 'vos' only sees an error
like this:

    $ vos delentry 123456
    Could not delete entry for volume 123456
    You must specify a RW volume name or ID (the entire VLDB entry will be deleted)
    VLDB: no such entry
    Deleted 0 VLDB entries

Which is the exact same error message if the user tries to delete a
volume that does not actually exist.

We currently do not have an error code that clearly says that the
database appears corrupted and needs to be fixed, but we can at least
log an error in VLLog for this case, to give the administrator a
chance at fixing the situation. So, log a message in this situation.

Change-Id: I4f0ee8749a90441e1f8d779890293dc5d1d9dbee
Reviewed-on: https://gerrit.openafs.org/13382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/vlserver/vlutils.c