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

Johannes Truschnigg johannes at truschnigg.info
Fri Feb 2 13:41:43 UTC 2018

Hi Cao,

On Fri, Feb 02, 2018 at 09:08:58PM +0800, 曹树烽 wrote:
> Hi, Johannes:
> > 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.
> Thanks very much for this information.
> Is this documented? So that I can report this to my boss. I googled this for sort of time.

I'm afraid the answer to this question depends on the platform, too. Linux'
man-pages don't mention directory fds specifically in fsync(3p) [0], but you may
want to read [1] to learn more about the problem space.

The sqlite project has a very good reputation for making sure its writes are
durable, and has a very clean code base. You might want to look around in
there how they do things for "best practises" to follow.

[0]: http://man7.org/linux/man-pages/man3/fsync.3p.html
[1]: http://blog.httrack.com/blog/2013/11/15/everything-you-always-wanted-to-know-about-fsync/

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/bb6d9977/signature.sig>

More information about the samba mailing list