]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: fix partial cluster initialization
authorEric Whitney <enwlinux@gmail.com>
Sun, 23 Nov 2014 05:55:42 +0000 (00:55 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 23 Nov 2014 05:55:42 +0000 (00:55 -0500)
commitf4226d9ea400e7124120571b1e89504c79f2e953
treec3c53be4a83b3293f0baf269737622c4ded94058
parentb93b41d4c7338dda9304eaac9d3b40da43198806
ext4: fix partial cluster initialization

The partial_cluster variable is not always initialized correctly when
hole punching on bigalloc file systems.  Although commit c06344939422
("ext4: fix partial cluster handling for bigalloc file systems")
addressed the case where the right edge of the punched region and the
next extent to its right were within the same leaf, it didn't handle
the case where the next extent to its right is in the next leaf.  This
causes xfstest generic/300 to fail.

Fix this by replacing the code in c0634493922 with a more general
solution that can continue the search for the first cluster to the
right of the punched region into the next leaf if present.  If found,
partial_cluster is initialized to this cluster's negative value.
There's no need to determine if that cluster is actually shared;  we
simply record it so its blocks won't be freed in the event it does
happen to be shared.

Also, minimize the burden on non-bigalloc file systems with some minor
code simplification.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents.c