fix braino in generic_file_read_iter()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 May 2017 17:54:47 +0000 (13:54 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 May 2017 17:54:47 +0000 (13:54 -0400)
commit5b47d59af68a8735e4637bacedcb4baf6f47c73f
treeca26a750a251a2d70c9c3f1616aa58f0c1c3c46d
parenta6a5993243550b09f620941dea741b7421fdf79c
fix braino in generic_file_read_iter()

Wrong sign of iov_iter_revert() argument.  Unfortunately, slipped through
the testing, since most of the time we don't do anything to the iterator
afterwards and potential oops on walking the iter->iov too far backwards
is too infrequent to be easily triggered.

Add a sanity check in iov_iter_revert() to catch bugs like this one;
fortunately, the same braino hadn't happened in other callers, but we'd
better have a warning if such thing crops up.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lib/iov_iter.c
mm/filemap.c