diff options
author | Jeremy Allison <jra@samba.org> | 2009-01-13 11:24:24 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-01-14 14:03:55 +0100 |
commit | ae72dbdf5fc8ee5c4e4d9321f0bd8dc106f910bd (patch) | |
tree | 521d4a005aa8ef2cd74ec8ecb6698811e42253d4 | |
parent | 4843a9dff1d9692a0bf49eb8879d5f04a4b7556e (diff) | |
download | samba-ae72dbdf5fc8ee5c4e4d9321f0bd8dc106f910bd.tar.gz samba-ae72dbdf5fc8ee5c4e4d9321f0bd8dc106f910bd.tar.xz samba-ae72dbdf5fc8ee5c4e4d9321f0bd8dc106f910bd.zip |
Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy.
(cherry picked from commit 974262ba3e8226ec9805d38e602ec8d083e44f72)
-rw-r--r-- | source/lib/sendfile.c | 4 | ||||
-rw-r--r-- | source/smbd/reply.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/sendfile.c b/source/lib/sendfile.c index f4f6e16526f..4aa58c358f5 100644 --- a/source/lib/sendfile.c +++ b/source/lib/sendfile.c @@ -66,7 +66,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of #endif } while (nwritten == -1 && errno == EINTR); if (nwritten == -1) { - if (errno == ENOSYS) { + if (errno == ENOSYS || errno == EINVAL) { /* Ok - we're in a world of pain here. We just sent * the header, but the sendfile failed. We have to * emulate the sendfile at an upper layer before we @@ -144,7 +144,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of nwritten = sendfile(tofd, fromfd, &small_offset, small_total); } while (nwritten == -1 && errno == EINTR); if (nwritten == -1) { - if (errno == ENOSYS) { + if (errno == ENOSYS || errno == EINVAL) { /* Ok - we're in a world of pain here. We just sent * the header, but the sendfile failed. We have to * emulate the sendfile at an upper layer before we diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d8cbfd8e87f..69a9885cad6 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -2213,9 +2213,9 @@ void send_file_readbraw(connection_struct *conn, files_struct *fsp, SMB_OFF_T st header.free = NULL; if ( SMB_VFS_SENDFILE( smbd_server_fd(), fsp, fsp->fh->fd, &header, startpos, nread) == -1) { - /* Returning ENOSYS or EINVAL means no data at all was sent. + /* Returning ENOSYS means no data at all was sent. Do this as a normal read. */ - if (errno == ENOSYS || errno == EINVAL) { + if (errno == ENOSYS) { goto normal_readbraw; } |