aboutsummaryrefslogtreecommitdiffstats
path: root/fs/seq_file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-09 19:22:17 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-09 19:22:17 -0800
commit878e66d06fd098a744b9caafdd0e99bba415ce37 (patch)
tree71a5cceab7713eb01b1a15a544124dbe2f6e07fc /fs/seq_file.c
parentc839682c719f0e3dc851951c9e2eeb8a41cd9609 (diff)
parentcf5eebae2cd28d37581507668605f4d23cd7218d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs fixes from Al Viro. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: seq_file: fix incomplete reset on read from zero offset kernfs: fix regression in kernfs_fop_write caused by wrong type
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r--fs/seq_file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 4be761c1a03d..eea09f6d8830 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -181,8 +181,11 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
* if request is to read from zero offset, reset iterator to first
* record as it might have been already advanced by previous requests
*/
- if (*ppos == 0)
+ if (*ppos == 0) {
m->index = 0;
+ m->version = 0;
+ m->count = 0;
+ }
/* Don't assume *ppos is where we left it */
if (unlikely(*ppos != m->read_pos)) {

Privacy Policy