Treating share modes as advisory when set by Mac clients

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Mar 12 13:59:19 MDT 2012


On Mon, Mar 12, 2012 at 03:27:01PM -0400, Brian Campbell wrote:
> I work on network attached storage for video editing. Our customers use
> both Mac and Windows workstations, and on the Mac, they generally use
> Thursby Software's DAVE as a client, as it works much better than the
> built-in smbfs on Mac OS X.
> 
> On Mac OS X, when opening a file, you can request a shared or exclusive
> lock on the file using the O_SHLOCK or O_EXLOCK flags in the open() call.
> On local filesystems, these are implemented as locks with flock() semantics.
> 
> Thursby recently added support in DAVE to implement these flags using share
> modes (DENY_WRITE/DENY_ALL). They apparently did this because Microsoft
> Word depends on these locks working, and was getting confused when two
> people could edit the same file at the same time. This also appears to be
> how smbfs on Mac OS X implements these open() flags.
> 
> This has caused a problem for our customers using Final Cut (and possibly
> some other video editing software). When Final Cut writes files out in
> certain situations (renders, and log and transfer), it opens the file with
> the O_EXLOCK flag, and holds the file open with that exclusive lock even
> after it's done writing, until you close out the entire project. Locally,
> that doesn't cause any problems, since the lock is advisory and most
> software that needs to read the file doesn't try to obtain any locks on the
> file.

My initial reaction is that it is a bug in Final Cut, but
that does not help you much now. Does that behave in any way
differently if you store it on Windows servers? I can't
imagine that Final Cut can't be used when storing files
there. If Samba behaves differently, then we need
comparative network traces.

As an immediate relief, you might want to take a look at
"share modes = no". This is a per-share parameter which
makes Samba not use and respect share modes at all. You can
play similar tricks as mentioned in
https://wiki.samba.org/index.php/Client_specific_Log to
restrict the dangerous use to specific clients and specific
share.

With best regards,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list