From: Nathan Neulinger Date: Tue, 4 May 2004 10:31:55 +0000 (+0000) Subject: linux-handle-short-reads-gracefully-20040504 X-Git-Tag: openafs-devel-1_3_64~39 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=64b8ee9d887c4d7d669734e30bfd66c758efb51e;p=packages%2Fo%2Fopenafs.git linux-handle-short-reads-gracefully-20040504 break out of the read loop with EIO if we've reached EOF, rather than looping forever hoping the file will grow. --- diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 135429bb5..8a62d08d4 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -198,6 +198,13 @@ osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw) if (code < 0) { code = -code; break; + } else if (code == 0) { + /* + * This is bad -- we can't read any more data from the + * file, but we have no good way of signaling a partial + * read either. + code = EIO; + break; } iov->iov_base += code;