From: Jeremy Allison Date: Thu, 7 May 2020 19:45:10 +0000 (-0700) Subject: s3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to prote... X-Git-Tag: ldb-2.2.0~538 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf2e546be38abfc77cf40e0b0fef42937696dcde;p=thirdparty%2Fsamba.git s3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to protect against short reads. Note that as sys_pread_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 ff46966536b..bce50b990c1 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -838,10 +838,10 @@ static void vfs_pread_do(void *private_data) PROFILE_TIMESTAMP(&start_time); - do { - state->ret = pread(state->fd, state->buf, state->count, - state->offset); - } while ((state->ret == -1) && (errno == EINTR)); + state->ret = sys_pread_full(state->fd, + state->buf, + state->count, + state->offset); if (state->ret == -1) { state->vfs_aio_state.error = errno;