Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -1753,9 +1753,10 @@ static void __iov_iter_advance_iov(struc /* * The !iov->iov_len check ensures we skip over unlikely - * zero-length segments. + * zero-length segments. But we mustn't try to "skip" if + * we have come to the end (i->count == bytes). */ - while (bytes || !iov->iov_len) { + while (bytes || (unlikely(!iov->iov_len) && i->count > bytes)) { int copy = min(bytes, iov->iov_len - base); bytes -= copy;