The Samba-Bugzilla – Bug 6805
errno should not be used for async io. Moving code, write_behind is broken ...
Last modified: 2009-10-31 04:35:44 UTC
I had the problem that samba told me wrong error codes while debugging changes to async i/o code. It gave me an EINTR which was introduced by an select() interrupted by an aio signal, rather the correct code.
Root of the problem:
The errno variable should not be used to retrieve error codes for async i/o requests. It should use the codes retrieved by aio_error() before.
See for instance
This requires to move the ECANCELED detection to a different place and to handle the error code from aio_error() correctly.
With this patch samba should display correct error codes.
While inspecting the write_behind code I suspect that error handling for this is non-existing, it does not even report errors. So I placed a TODO line where error handling should happen.
Created attachment 4833 [details]
Patch relative to v3-4-test
Created attachment 4834 [details]
Patch relative to master
Perfectly correct - thanks ! Pushed to master and 3.5.0. I'll check the 3.4.x patch next.
Created attachment 4840 [details]
Slightly modified patch to correct the compile warning.
Created attachment 4841 [details]
Patch for 3.3.x.
Patch for 3.3.x (too late for 3.3.9 - possible for 3.3.10 if we do another 3.3.x release).
Volker please review the patch in attachment #4 [details] for possible inclusion in 3.4.3:
Please re-assign to Karolin if you agree. 3.4.3 code freeze is Oct. 15th so I think this can go in before that.
+1 on both the 3.3 and 3.4 patches.
Pushed to v3-3-test and v3-4-test.
Closing out bug report.