Paul Eggert <egg...@cs.ucla.edu> wrote: > On 01/08/2018 09:41 AM, Joerg Schilling wrote: > > POSIX explains that st_blocks counts in units of DEV_BSIZE. > > That's not required by the standard. It's merely a comment in the > <sys/stat.h> rationale "Traditionally, some implementations defined the > multiplier for /st_blocks/ in /<sys/param.h>/
My impression is that you look at the wrong things. POSIX does not require you to call fsync() before you are able to read written data from a file. POSIX does not require you to call fsync() before you are able to get the expected result from stat() If POSIX did make such assumptions, it would document then. The fact that there is no related text in POSIX is sufficient to prove what POSIX expects. So the real problem is not what exact value you may expect but rather whether btrfs behaves inconsistent because you get different results after calling fsync(). BTW: From the original report, the value in st_blocks seems to be OK after fsync() was called. Jörg -- EMail:jo...@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'