Windows: Protect buffers in smb_WriteData from simultaneous writes
smb_WriteData does not properly use CM_SCACHESYNC_WRITE to
protect buffers from simultaneous writes. Instead of simply
testing CM_SCACHESYNC_WRITE at the top of the while loop,
the flag must remain set until the entire write completes.
cm_SyncOp is now called once and cm_SyncOpDone is only called
upon final success or error.
In addition, as 'count' is unsigned, the test for count < 0
is replaced with count != 0.
LICENSE MIT
Change-Id: I82c8dc20e62079b13bf305e906f4744756aa0ac2
Reviewed-on: http://gerrit.openafs.org/1087
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>