mconsole_proc(): don't mess with file->f_pos
authorAl Viro <viro@ZenIV.linux.org.uk>
Sat, 10 Feb 2018 01:35:16 +0000 (01:35 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 10 Feb 2018 03:28:01 +0000 (19:28 -0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/mconsole_kern.c

index c4d162a94be9d612d6ec834c243b4626a6b15779..d5f9a2d1da1ba8f8e667e3fc781db1a5136432af 100644 (file)
@@ -130,6 +130,7 @@ void mconsole_proc(struct mc_request *req)
        struct file *file;
        int first_chunk = 1;
        char *ptr = req->request.data;
+       loff_t pos = 0;
 
        ptr += strlen("proc");
        ptr = skip_spaces(ptr);
@@ -148,7 +149,7 @@ void mconsole_proc(struct mc_request *req)
        }
 
        do {
-               len = kernel_read(file, buf, PAGE_SIZE - 1, &file->f_pos);
+               len = kernel_read(file, buf, PAGE_SIZE - 1, &pos);
                if (len < 0) {
                        mconsole_reply(req, "Read of file failed", 1, 0);
                        goto out_free;