[Samba] Bug in 3.6.0 saving files.

Linda Walsh samba at tlinx.org
Fri Aug 26 17:15:04 MDT 2011



Yes... more than one person has noticed it...

I think it has to do with SMB2 keeping multiple descriptors open in, 
perhaps, a cache,
to the same file...

When Windows writes 'many' (not all), files out, it will first 'create' 
the 'name' of the
new file to verify access in the target location, then it will write the 
file to a 2nd file
(xxxx.tmp), and at the end of it all, do a rename.  That way, if 
something interrupts, it,
you never get a partial file left there, either all or nothin'.


It's the rename that fails, & win deletes the tmp.

So when I saw this, I'd see ZERO length files under the name I'd saved,
and I'd find deleted 'tmp' dirs with the full content in the .recycle 
dir of my SMB share.


The exact cause I surmise, above, is _speculation_, based on a limited 
understanding
on some differences that SMB2 seems to allow that normally help achieve 
faster
overall performance.   But I think samba, is, not seeing those locks as 
'advisory', but as
mandatory, so it tells windows that someone has it locked --

either that, OR Window''s request to release the lock is getting lost or 
perhaps, just
delayed, so the rename attempts to manip a locked file (thus fail)...

Obviously speculations on my part as to cause, but you are 3rd person to 
note
the problem -- cept another noted it with files downloading w/web 
browsers, and I noticed
it on writing out large image files from photoshop ( files in the 1-2+GB 
range)...

-l




Justin Piszcz wrote:
> Hi,
>
> If you open a word document on a Windows 7 PC on a samba share and 
> attempt to save it (or ppt, etc) it will fail (SMB2 enabled).
>
> Go back to 3.5.10, it works fine (SMB2 removed obviously).
>
> Not sure if anyone has seen this but FYI.
>
> Happens with Office 2007 & 2010.
>
> Justin.



More information about the samba mailing list