summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-09-06 04:42:32 +0300
committerSasha Levin <alexander.levin@verizon.com>2017-01-15 17:49:51 +0300
commit79762247b6a0ec1b6f45e3ae7213e7e9b400e05c (patch)
tree73372249620657948d466e9043254935e7662992 /fs/nfs
parent1a1f89b31f5e3542655171172e853e3dd920d3f9 (diff)
downloadlinux-79762247b6a0ec1b6f45e3ae7213e7e9b400e05c.tar.xz
nfs_write_end(): fix handling of short copies
[ Upstream commit c0cf3ef5e0f47e385920450b245d22bead93e7ad ] What matters when deciding if we should make a page uptodate is not how much we _wanted_ to copy, but how much we actually have copied. As it is, on architectures that do not zero tail on short copy we can leave uninitialized data in page marked uptodate. Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 2ab6f00dba5b..c85da0fc4593 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -410,7 +410,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
*/
if (!PageUptodate(page)) {
unsigned pglen = nfs_page_length(page);
- unsigned end = offset + len;
+ unsigned end = offset + copied;
if (pglen == 0) {
zero_user_segments(page, 0, offset,