EINVAL is also a valid error return, meaning "this filesystem
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 Aug 2008 16:59:20 +0000 (09:59 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 12 Jan 2009 09:11:48 +0000 (10:11 +0100)
cannot do sendfile for this file"
(cherry picked from commit 5f30f87dcbeaf30713fadeb130193cb86021e87f)

source/smbd/reply.c

index faeb90d50bc37df01bd2bf3f4a029eb00ec7f043..bccd1164855c8cc05003297390392d1b23aa8614 100644 (file)
@@ -2213,8 +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 means no data at all was sent. Do this as a normal read. */
-                       if (errno == ENOSYS) {
+                       /* Returning ENOSYS or EINVAL means no data at all was sent.
+                          Do this as a normal read. */
+                       if (errno == ENOSYS || errno == EINVAL) {
                                goto normal_readbraw;
                        }