LICENSE MIT
Fix smb_FindFIDByScache() to avoid obtaining the smb_fid_t.mx and
smb_rctLock out of order. Doing so requires obtaining references
on each smb_fid_t belonging to the smb_vc_t in order to prevent them
from being removed from the list while the list is being walked.
Reorder tests for CM_SCACHEFLAG_DELETED and smb_fid_t.scp to make
them more efficient and consistent.
When processing Tran2SetPathInfo do not fail because an smb_fid_t
cannot be found for the path object. The PathInfo function is
being used because we do not have a file descriptor. Most importantly
do not fail by returning success.
(cherry picked from commit 8382f8ccb1)
LICENSE MIT
Problems with the cm_Rename() functions:
* when a rename occurs across directories, the file server allocates
a new vnode which in turn alters the FID. Since the new FID and
potentially version number is unknown to the client, it is not
possible to update the target directory with the new name and
FID thereby avoiding reading the directory from the file server.
* when the old vnode is removed, the callback is broken but the
client did not discard the cm_scache_t object
In order to optimize the client cache AFS requires a RXAFS_RenameEx
rpc that is equivalent to the current RPC but returns the new FID
and status. This would permit the cache manager to relabel the
data buffers and cm_scache_t that are known to contain valid data.
(cherry picked from commit 54a3c85ae4)
LICENSE MIT
When processing SMB_SESSION_SETUP_ANDX in smb_ReceiveV3SessionSetupX
it is possible that the smb client might indicate that it requires an
Mpx Count greater than we are configured to support. If so, log it
to the Windows Event Log as a warning.
It is also possible that the client might specify that its maximum
receive buffer is smaller than the SMB_PACKETSIZE. If so, log it
to the Windows Event Log as a warning.
Finally, if the client specifies a virtual circuit number of zero,
the client thinks this is its first time communicating with us.
In which case we should invalidate all prior virtual circuits.
We also log this request to the Windows Event Log as informational.
(cherry picked from commit 4eb808d26b)
LICENSE MIT
FIXES 124293
As evident in a crash dump, there is a race surrounding access to the
scp field of the smb_fid_t object. Not all access was protected by
the smb_fid_t mx and the cm_scache_t object was not always being
reference counted within the accessing function.
This patch ensures that all initial references to the scp object
are performed under the smb_fid_t mx mutex and that the cm_scache_t
is prevented from being recycled by obtaining a local reference.
Finally, CM_ERROR_BADFD is returned as an error if a request begins
after the smb_fid_t scp field has already been cleared by a smb_CloseFID()
call as part of a concurrent request.
(cherry picked from commit 8e3b67b953)
LICENSE MIT
FIXES 124276
A readonly volume with multiple instances was being marked alldown
when one of the instances resulted in VNOVOL because the vldb and
the indicated file server were out of sync. The cache manager would
then attempt to re-obtain the volume location info from the vldb
for the entire timeout period.
This patch:
adds trace logging to cm_Analyze indicating which server references
are being deleted and which remain in response to a VNOVOL/VMOVED error.
adds trace logging to cm_UpdateVolumeStatusInt showing how the
new volume status value is determined.
corrects cm_Analyze() so that it doesn't corrupt the server reference
list during cm_FreeServerList() calls; doesn't orphan the server reference
list by setting *serverpp to NULL; and only re-obtains the volume info
list once per request.
(cherry picked from commit 8bb35234aa)
LICENSE BSD
In rxi_WritevProc the queueScan that sets RX_PKTFLAG_TQ on the packet
really needs to cast the queue objects to rx_packet instead of rx_call.
Trashing random fields is not a good idea.
(cherry picked from commit 0edbc512b5)
LICENSE BSD
Fix the -parallel example in the main description text: "5all" should be
"all5". Reword the description a bit to hopefully make it clearer that
there are two separate values set here. Note under the option description
of -parallel that multiple partitions on the same device are normally
processed serially.
(cherry picked from commit d476340465)
LICENSE MIT
separate rx debugging from cache manager debugging.
assign bit 5 of the TraceOption registry value to activation of
rx debug output via DebugOutputString().
(cherry picked from commit 50d57f6c7b)
LICENSE MIT
confirmed that rx_ReadvProc, rx_WritevProc, and rx_WritevAlloc are
properly implemented for Windows. Add them to the public export list.
Add rx_ReadProc32 and rx_WriteProc32 to the public export list.
(cherry picked from commit 306a7761b3)
LICENSE MIT
The WinSock API does not include the Posix recvmsg/sendmsg interfaces.
Beginning with XP/2003 Microsoft began to support WSARecvMsg which is
a mostly compatible implementation of recvmsg. In Vista/2008 Microsoft
began to support WSASendMsg a mostly compatible implementation of sendmsg.
Neither are part of the WinSock API and therefore they must be loaded
at runtime via a WSAIoctl() call to obtain the function pointers.
When the functions are available it is now possible to avoid a large
number of memcpy() calls.
This patch also enables UDP port unreachable messages on XP and above.
(cherry picked from commit a4f63a818e)
LICENSE MIT
In rx_SlowWritePacket the use of RX_MAXWVECS was incorrect. The
niovecs field is allocated as [RX_MAXWVECS+1] with the 0th element
reserved for the rx header. niovecs[RX_MAXWVECS] is therefore a
valid data buffer and the comparison should be (i <= RX_MAXWVECS).
This error has most likely not been noticed previously because
nothing in the OpenAFS source tree uses this function.
(cherry picked from commit 6e8039e8a5)
LICENSE IPL10
FIXES 124211
restructure so we can save info necessary to keep dirty changes across offline
shutdown
(cherry picked from commit 8552f84b8e)
LICENSE MIT
Modify the cm_BPlusDirEnum interface:
* add the cm_scache_t * of the directory being enumerated to the
cm_direnum_t object
* remove the cm_scache_t * from the cm_BPlusDirEnumBulkStat call
now that it is part of the cm_direnum_t object
* maintain a reference to the cm_scache_t for the life of the
cm_direnum_t object. This ensures that the object cannot be
recycled while the enumeration is in use.
(cherry picked from commit e42a066da1)