]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix partial cluster handling for bigalloc file systems
authorEric Whitney <enwlinux@gmail.com>
Fri, 14 Mar 2014 03:34:16 +0000 (23:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Mar 2014 03:34:16 +0000 (23:34 -0400)
commit2330d8bc36fa91a0d269b0163e9371e648fbb090
treecd1e8bca57f33b3055da679867efdf7dabe673ab
parent87beaec31821c4d96038085089672ea516055048
ext4: fix partial cluster handling for bigalloc file systems

Commit c1588b3a47, which enables hole punching for bigalloc file
systems, exposed a bug introduced by commit f80ec25bb2 in an earlier
release.  When run on a bigalloc file system, xfstests generic/013, 068,
075, 083, 091, 100, 112, 127, 263, 269, and 270 fail with e2fsck errors
or cause kernel error messages indicating that previously freed blocks
are being freed again.

The latter commit optimizes the selection of the starting extent in
ext4_ext_rm_leaf() when hole punching by beginning with the extent
supplied in the path argument rather than with the last extent in the
leaf node (as is still done when truncating).  However, the code in
rm_leaf that initially sets partial_cluster to track cluster sharing on
extent boundaries is only guaranteed to run if rm_leaf starts with the
last node in the leaf.  Consequently, partial_cluster is not correctly
initialized when hole punching, and a cluster on the boundary of a
punched region that should be retained may instead be deallocated.

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