The Samba-Bugzilla – Attachment 13501 Details for
Bug 12983
async read/write/fsync don't correctly return errors in vfs_aio_state.error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for Samba 4.6
patch-for-4.6 (text/plain), 2.33 KB, created by
Christof Schmitt
on 2017-08-24 18:08:12 UTC
(
hide
)
Description:
Patch for Samba 4.6
Filename:
MIME Type:
Creator:
Christof Schmitt
Created:
2017-08-24 18:08:12 UTC
Size:
2.33 KB
patch
obsolete
>From 06d8133147b492e9421f2a2c25fc01cc65fb21d8 Mon Sep 17 00:00:00 2001 >From: Christof Schmitt <cs@samba.org> >Date: Wed, 23 Aug 2017 14:37:28 -0700 >Subject: [PATCH] vfs_default: Fix passing of errno from async calls > >Current code assigns errno from async pthreadpool calls to the >vfs_default internal vfswrap_*_state. The callers of the vfs_*_recv >functions expect the value from errno in vfs_aio_state.error. > >Correctly assign errno to vfs_aio_state.error and remove the unused >internal err variable. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12983 > >Signed-off-by: Christof Schmitt <cs@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit a6f391b8dd1fbfd1a370667dec1374284984c341) >--- > source3/modules/vfs_default.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c >index 53a116c..ce1b6e2 100644 >--- a/source3/modules/vfs_default.c >+++ b/source3/modules/vfs_default.c >@@ -722,7 +722,6 @@ static int vfswrap_init_pool(struct smbd_server_connection *conn) > > struct vfswrap_pread_state { > ssize_t ret; >- int err; > int fd; > void *buf; > size_t count; >@@ -796,7 +795,9 @@ static void vfs_pread_do(void *private_data) > state->offset); > } while ((state->ret == -1) && (errno == EINTR)); > >- state->err = errno; >+ if (state->ret == -1) { >+ state->vfs_aio_state.error = errno; >+ } > > PROFILE_TIMESTAMP(&end_time); > >@@ -845,7 +846,6 @@ static ssize_t vfswrap_pread_recv(struct tevent_req *req, > > struct vfswrap_pwrite_state { > ssize_t ret; >- int err; > int fd; > const void *buf; > size_t count; >@@ -919,7 +919,9 @@ static void vfs_pwrite_do(void *private_data) > state->offset); > } while ((state->ret == -1) && (errno == EINTR)); > >- state->err = errno; >+ if (state->ret == -1) { >+ state->vfs_aio_state.error = errno; >+ } > > PROFILE_TIMESTAMP(&end_time); > >@@ -968,7 +970,6 @@ static ssize_t vfswrap_pwrite_recv(struct tevent_req *req, > > struct vfswrap_fsync_state { > ssize_t ret; >- int err; > int fd; > > struct vfs_aio_state vfs_aio_state; >@@ -1029,7 +1030,9 @@ static void vfs_fsync_do(void *private_data) > state->ret = fsync(state->fd); > } while ((state->ret == -1) && (errno == EINTR)); > >- state->err = errno; >+ if (state->ret == -1) { >+ state->vfs_aio_state.error = errno; >+ } > > PROFILE_TIMESTAMP(&end_time); > >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 12983
: 13501 |
13502