s3: VFS: default. Change pread() -> sys_pread_full() in SMB_VFS_PREAD_SEND() to prote...
authorJeremy Allison <jra@samba.org>
Thu, 7 May 2020 19:45:10 +0000 (12:45 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 14 May 2020 07:25:45 +0000 (07:25 +0000)
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 <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit bf2e546be38abfc77cf40e0b0fef42937696dcde)

source3/modules/vfs_default.c

index e516c733e692af6de0381c7c30229ff5995b1ab8..809c9b3d92f8546151a4b14a1ce021357fd75115 100644 (file)
@@ -843,10 +843,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;