OpenAFS CVS Commit: openafs/src/volser by jaltman

Mon, 17 Apr 2006 11:22:27 EDT

Update of /cvs/openafs/src/volser
In directory GRAND.CENTRAL.ORG:/home/jaltman/openafs/cvs-1-4/src/volser

Modified Files:
      Tag: openafs-stable-1_4_x
Log Message:
DELTA STABLE14-volser-dump-validate-input-20060417

This patch adds code to perform return code error checking for all calls
to the ReadXyz() routines.  If the rx connection was lost or if the dump
format being parsed was incorrect there was an opportunity for data to
the processed after an error had already been detected.  In the best case
this would have simply resulted in additional work being performed when
it was not necessary but there was also the potential for modifying return
values which would later be used as input to later operations.  Better
to simply catch the error when it initially occurs and be done with it.

The ReadString() function had the potential to write into one byte prior
to the start of the input array.

ProcessIndex() would not properly close Fdhandle nor the StreamHandle
if an error was detected.

RestoreVolume() had a problem with the processing of incremental dumps.
Originally AFS supported a concept of incrementals dumps which when
restored would simply add their contents to the existing volume.  One
of the distinctions between the incremental and full dumps is that full
dump processing is responsible for removing any vnode entries from the
volume that are not present in the dump file headers.  When the incremental
dump support was removed, the RestoreVolume() function was broken.  If
a dump file contains multiple Dump Headers, then only the vnode entries
in the first Dump Header would be marked as being restored.  Any vnode
entries restored from subsequent Dump Headers would be deleted when the
RestoreVolume() function reached the end.  By removing the assignment
of 'tdelo = -1' within the loop that processes the Dump Headers, this
bug is resolved.  Although RestoreVolume is only called with the
'incremental' parameter == 0 at the current time, the check for non-zero
values is restored and the "remove unrestored vnodes" functionality is
disabled when a non-zero value is provided.

The ReadVnodes() function did not perform error checking.

--- DELTA config for openafs-stable-1_4_x follows ---
STABLE14-volser-dump-validate-input-20060417 openafs/src/volser/dumpstuff.c 1.25