mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]>
This commit is contained in:
parent
a6a5993243
commit
5b47d59af6
2 changed files with 3 additions and 1 deletions
|
|
@ -2048,7 +2048,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
|
|||
iocb->ki_pos += retval;
|
||||
count -= retval;
|
||||
}
|
||||
iov_iter_revert(iter, iov_iter_count(iter) - count);
|
||||
iov_iter_revert(iter, count - iov_iter_count(iter));
|
||||
|
||||
/*
|
||||
* Btrfs can have a short DIO read if we encounter
|
||||
|
|
|
|||
Loading…
Reference in a new issue