Web lists-archives.com

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




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.


Thanks again!

Best Regards
Cao


在 2018年02月02日 20:59, Johannes Truschnigg 写道:
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!





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