]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: fix 2nd xfstests 127 punch hole failure
authorAllison Henderson <achender@linux.vnet.ibm.com>
Mon, 22 Aug 2011 19:02:53 +0000 (15:02 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Aug 2011 19:02:53 +0000 (15:02 -0400)
commit6c123c345b0438cd430c34862d468d291641bc33
tree82b1091b3112bfd98118337a651b0dbec160e3d2
parent1012addb24511b52353b4859f1763c32105df6e8
ext4: fix 2nd xfstests 127 punch hole failure

This patch fixes a second punch hole bug found by xfstests 127.

This bug happens because punch hole needs to flush the pages
of the hole to avoid race conditions.  But if the end of the
hole is in the same page as i_size, the buffer heads beyond
i_size need to be unmapped and the page needs to be zeroed
after it is flushed.

To correct this, the new ext4_discard_partial_page_buffers
routine is used to zero and unmap the partial page
beyond i_size if the end of the hole appears in the same
page as i_size.

The code has also been optimized to set the end of the hole
to the page after i_size if the specified hole exceeds i_size,
and the code that flushes the pages has been simplified.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c