Skip to content

Commit

Permalink
NeilBrown <[email protected]>
Browse files Browse the repository at this point in the history
The do_loop_readv_writev implementation of readv breaks out of the loop as
soon as a single read request didn't fill it's buffer:

		if (nr != len)
			break;

The generic_file_aio_read version doesn't.  So if it hits EOF before the end
of the list of buffers, it will try again on the next buffer.  If the file was
extended in the mean time, this will produce a bad result.

Signed-off-by: Neil Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and Linus Torvalds committed Jul 16, 2007
1 parent 5ed44a4 commit c44939e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
retval = retval ?: desc.error;
break;
}
if (desc.count > 0)
break;
}
}
out:
Expand Down

0 comments on commit c44939e

Please sign in to comment.