mirror of
https://github.com/samba-team/samba.git
synced 2025-07-30 19:42:05 +03:00
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 a6f391b8dd
)
Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Mon Aug 28 14:42:02 CEST 2017 on sn-devel-144
This commit is contained in:
committed by
Karolin Seeger
parent
85063757ad
commit
76da233af1
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user