Skip to content

Commit 8a2bcaa

Browse files
Al Virogregkh
authored andcommitted
nfs_write_end(): fix handling of short copies
commit c0cf3ef5e0f47e385920450b245d22bead93e7ad upstream. 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. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b66e312 commit 8a2bcaa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
407407
*/
408408
if (!PageUptodate(page)) {
409409
unsigned pglen = nfs_page_length(page);
410-
unsigned end = offset + len;
410+
unsigned end = offset + copied;
411411

412412
if (pglen == 0) {
413413
zero_user_segments(page, 0, offset,

0 commit comments

Comments
 (0)