]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iov_iter_advance() fix
authorNick Piggin <npiggin@suse.de>
Tue, 11 Mar 2008 01:50:06 +0000 (01:50 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 24 Mar 2008 18:47:10 +0000 (11:47 -0700)
commitb6845726368e5b7b086e6d6438c9380bf5b7bc1c
tree33f6a7f3784686ea08b19f56cf01f36718a11c78
parentcc7571b226c93b032164ebb3ff3b365651c4652f
iov_iter_advance() fix

commit: f7009264c519603b8ec67c881bd368a56703cfc9

iov_iter_advance() skips over zero-length iovecs, however it does not properly
terminate at the end of the iovec array.  Fix this by checking against
i->count before we skip a zero-length iov.

The bug was reproduced with a test program that continually randomly creates
iovs to writev.  The fix was also verified with the same program and also it
could verify that the correct data was contained in the file after each
writev.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Tested-by: "Kevin Coffman" <kwc@citi.umich.edu>
Cc: "Alexey Dobriyan" <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/filemap.c