Skip to content

Commit

Permalink
nfs_write_end(): fix handling of short copies
Browse files Browse the repository at this point in the history
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: [email protected]
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Dec 10, 2016
1 parent e5517c2 commit c0cf3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,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,
Expand Down

0 comments on commit c0cf3ef

Please sign in to comment.