[Samba] Does samba support fsync() a directory?

Johannes Truschnigg johannes at truschnigg.info
Fri Feb 2 12:59:10 UTC 2018


Hi!

Afair, fsync()ing a directory is subject to platform-specific and
implementation-defined behaviour, and may either

 - work as you'd want and (probably) expect
 - fail with an error
 - fail silently

at least if your application targets more than one operating system/kernel -
and even on one and the same platform, different filesystems might exhibit
sublty different patterns of behaviour.

So whatever you do, it's probably best to assume that the fsync() operation on
your dir fd is going to fail, and route around that (potential) failure as
best as you can.

It still can be beneficial to try fsync()ing to try as hard as possibe to get
operations against the directory as consistent as possible in face of a
potential crash.

Hth!

-- 
with best regards:
- Johannes Truschnigg ( johannes at truschnigg.info )

www:   https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp:  johannes at truschnigg.info

Please do not bother me with HTML-email or attachments. Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba/attachments/20180202/2f131c14/signature.sig>


More information about the samba mailing list