spacejam / rio

pure rust io_uring library, built on libc, thread & async friendly, misuse resistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fsync and fsyncdata error cases

Justarone opened this issue · comments

I found weird situation: if I constantly use fsync application works steadily, but if I change it on fsyncdata, it sometimes returns error: Bad file descriptor (os error 9). In linux man I found only one thing, which MAY cause an error (but does it?): (read the paragraph, which start from fdatasync() is similar to fsync()) https://man7.org/linux/man-pages/man2/fdatasync.2.html.
So do I understand it right: if some data sensitive metadata changed (size, for example) fdatasync returns error? I am a little bit confused, because bad file descriptor doesn't point on need to fsync metadata either.
Sorry in advance if this question is silly, I am not experienced enough:C

I am sorry, I'll show you my case, in which it doesn't work appropriate way:
qoollo/pearl@aab6804
After this changes ioring started to work steadily. You may run tests for both versions and see the differences (run them twice for bad version and on the second run it'll return many errors)

I misunderstood: fdatasync does update necessary metadata itself. Now I am totally confused, is it a bug then?