dir: distinguish logical and physical errors on reads
The directory package (src/dir) salvage routines DirOK and DirSalvage
check a global variable 'DErrno' to distinguish logical errors (e.g.
short read) from physical errors (e.g. EIO). However, since the
original IBM import, this logic has not worked correctly because there
is no longer any code that sets the value of DErrno - its value is
always zero.
Instead, modify all implementations of ReallyRead to optionally return
the errno for low-level IO errors.
Also, create a new userspace-only variant - DReadWithErrno() - of the
src/dir/buffer.c version of DRead (the version called by DirOK and
DirSalvage, and the only caller of ReallyRead) to return the ReallyRead
errno upon request.
Also create an analogous variant of afs_dir_GetBlobs,
afs_dir_GetBlobsWithErrno().
Finally, convert DirOK and DirSalvage to use the new variants and
replace DErrno with equivalent logic. Remove all other references to
DErrno.
Change-Id: I3de182ce49c1682572142da594af5dc2c00ede74
Reviewed-on: https://gerrit.openafs.org/13798
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>