xfs: handle EOF correctly in xfs_vm_writepage
authorChristoph Hellwig <hch@infradead.org>
Tue, 3 Jul 2012 16:20:00 +0000 (12:20 -0400)
committerBen Myers <bpm@sgi.com>
Sun, 22 Jul 2012 15:42:56 +0000 (10:42 -0500)
We need to zero out part of a page which beyond EOF before setting uptodate,
otherwise, mapread or write will see non-zero data beyond EOF.

Based on the code in fs/buffer.c and the following ext4 commit:

  ext4: handle EOF correctly in ext4_bio_write_page()

And yes, I wish we had a good test case for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>

No differences found