diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-04-16 12:02:43 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-04-16 12:02:43 +0200 |
commit | 496156e3647f44e2aab3e64f86b63294afca458a (patch) | |
tree | de4c35460ef0249623d45627ad40abad07b8e7cf /fs/read_write.c | |
parent | cabf5ebbabcd4ad59b6eb216876c4c2e56fd3386 (diff) | |
parent | 618d919cae2fcaadc752f27ddac8b939da8b441a (diff) | |
download | linux-stable-496156e3647f44e2aab3e64f86b63294afca458a.tar.gz linux-stable-496156e3647f44e2aab3e64f86b63294afca458a.tar.bz2 linux-stable-496156e3647f44e2aab3e64f86b63294afca458a.zip |
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 177ccc3d405a..61b43ad7608e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -560,12 +560,13 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ static inline loff_t file_pos_read(struct file *file) { - return file->f_pos; + return file->f_mode & FMODE_STREAM ? 0 : file->f_pos; } static inline void file_pos_write(struct file *file, loff_t pos) { - file->f_pos = pos; + if ((file->f_mode & FMODE_STREAM) == 0) + file->f_pos = pos; } ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) |