[jcifs] Curious "race" condition

Michael B Allen ioplex at gmail.com
Fri Oct 22 15:37:25 MDT 2010

On Fri, Oct 22, 2010 at 12:54 PM, Caldarale, Charles R
<Chuck.Caldarale at unisys.com> wrote:
>> From: jcifs-bounces at lists.samba.org [mailto:jcifs-bounces at lists.samba.org] On Behalf Of André Warnier
>> Subject: Re: [jcifs] Curious "race" condition
>> I was just wondering if somehow, even if extremely unlikely,
>> there could be some small window of time while program A was
>> in the process of renaming the file across a SMB share, and
>> process B is reading that same directory and opening that file,
>> where program B /could/ find a directory entry associated to a
>> zero-size file.
> We have customers doing essentially the same thing, albeit with our own proprietary SMB server, not Samba.
> Would it be possible to send me a Wireshark or tcpdump capture of the renaming portion of the process?  I'd like to see the exact sequence of SMB commands sent over the wire, and I could then look in the Samba source to see how it interprets them (and compare that with what we do on our platform).
> Assuming Samba is doing a true rename, there should be no window where the file size appears to be zero.  However, if it's implemented as a copy and delete, there would be.

Yeah, definitely get a capture and verify that the rename part is
actually resulting in an SMB_COM_RENAME command. It could be that if
the Windows client program is using some .NET assembly or something
that it's not actually implemented as expected.

Also, if the volume being shared and where file are being written /
renamed is NFS mounted, that would definitely be something to


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list