From: Jeremy Allison Date: Thu, 7 May 2020 19:48:49 +0000 (-0700) Subject: s3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to... X-Git-Tag: ldb-2.2.0~537 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=801c06f4c9400343b72cad998086288931f7c6b3;p=thirdparty%2Fsamba.git s3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to protect against short writes. Note that as sys_pwrite_full() deals with the EINTR case we can remove the do {} while loop here. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361 Signed-off-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index bce50b990c1..386a34f81d1 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -966,10 +966,10 @@ static void vfs_pwrite_do(void *private_data) PROFILE_TIMESTAMP(&start_time); - do { - state->ret = pwrite(state->fd, state->buf, state->count, - state->offset); - } while ((state->ret == -1) && (errno == EINTR)); + state->ret = sys_pwrite_full(state->fd, + state->buf, + state->count, + state->offset); if (state->ret == -1) { state->vfs_aio_state.error = errno;