Web lists-archives.com

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




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@xxxxxxxxxxxxxxx )

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

Please do not bother me with HTML-email or attachments. Thank you.

Attachment: signature.asc
Description: PGP signature

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba