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.
The 'active_vcp' variable is no longer being used for any useful
purpose and is the center of a race condition that could lead to
an undercount of references to 'vcp' objects. Remove it.
An undercount has been detected of the smb_vc_t objects stored
in the smb_allVCsp list. Unfortunately, we have yet to be able
to find the cause of the undercount so this patch adds logic to
protect against the side effects until such time as the cause
can be identified.
The old StoreData RPC is only supposed to be valid for files
smaller than 2GB. When StoreData64 was added, StoreData and StoreData64
were implemented as calls to common_StoreData64. This removed the bounds
checking on the old StoreData RPC making it possible for operations
beyond two 2GB to be requested even if the file server cannot support
them. This patch adds a validity check to ensure that the requested
file operations remain below 2GB. Failures return E2BIG.
as pointed out by cg2v@andrew.cmu.edu the addition of performance
collection data for the GetCapabilities RPC broke backward compatibility
with previous builds because it altered the size of the data structure
sent on the wire.
Instead we count the number of GetCapabilties calls but do not gather
performance timing data as this can be done using spare fields.
FIXES 25849
an interface which lets you select md5 based inode numbers, and the csupporting code
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
FIXES 25849
an interface which lets you select md5 based inode numbers, and the c^?supportin
g code
Fix syntax error (missing braces)
Fix include file ordering
Don't declare *tmpdir extern, we're initializing it here (even though
there's no reason to)
Fix OnlyOneVolume args to match proto
64-bit time_t pointer update
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
correct a type for consistency
====================
corrections to the dafs delta to allow compilation on Windows