Bug 12983 - async read/write/fsync don't correctly return errors in vfs_aio_state.error
async read/write/fsync don't correctly return errors in vfs_aio_state.error
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-23 23:01 UTC by Jeremy Allison
Modified: 2017-08-30 07:19 UTC (History)
2 users (show)

See Also:


Attachments
Patch for Samba 4.6 (2.33 KB, patch)
2017-08-24 18:08 UTC, Christof Schmitt
jra: review+
Details
Patch for Samba 4.7 (2.33 KB, patch)
2017-08-24 18:08 UTC, Christof Schmitt
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2017-08-23 23:01:34 UTC
Reported by Christof Schmitt <cs@samba.org> on samba-technical@lists.samba.org

I found this while testing with a system where the actual write() system
call returned an error. This led to Samba hanging and never continuing
with the result of the write. The attached patch fixes the problem. From
what i understand, errno was never passed correctly back to the callers.

Christof

Patch to follow.
Comment 1 Christof Schmitt 2017-08-24 18:08:12 UTC
Created attachment 13501 [details]
Patch for Samba 4.6
Comment 2 Christof Schmitt 2017-08-24 18:08:42 UTC
Created attachment 13502 [details]
Patch for Samba 4.7
Comment 3 Jeremy Allison 2017-08-24 21:05:27 UTC
Re-assigning to Karolin for inclusion in 4.7.0 and 4.6.next.
Comment 4 Stefan Metzmacher 2017-08-25 07:50:15 UTC
(In reply to Jeremy Allison from comment #3)

Shouldn't this be also fixed in 4.5?
Comment 5 Jeremy Allison 2017-08-25 16:39:44 UTC
4.5.x doesn't have this problem. It uses the asys_XXX() code (no longer used in 4.6.x or above) and correctly sets vfs_aio_state.error inside:

vfswrap_asys_finished() in:

 903                 state->ret = result->ret;
 904                 state->vfs_aio_state.error = result->err;
 905                 state->vfs_aio_state.duration = result->duration;

So these patches are good to go to close this bug out.

Jeremy.
Comment 6 Karolin Seeger 2017-08-28 08:47:02 UTC
Pushed to autobuild-v4-{7,6}-test.
Comment 7 Karolin Seeger 2017-08-30 07:19:41 UTC
Pushed to both branches.
Closing out bug report.

Thanks!