lseek() further than length of the file will leave stale ->index
(second-to-last during iteration). Next seq_read() will not notice
that ->f_pos is big enough to return 0, but will print last item
as if ->f_pos is pointing to it.
Introduced in commit
5069a9adf8b3d9f23fdcd57df89d58b9b62d090d
aka "seq_file: more atomicity in traverse()".
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
p = m->op->next(m, p, &index);
}
m->op->stop(m, p);
+ m->index = index;
return error;
Eoverflow: