ext4: Fix data corruption when writing to prealloc area
commitd03856bd5e5abac717da137dc60fe4a691769bd0
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sat, 2 Aug 2008 22:51:32 +0000 (2 18:51 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Aug 2008 22:51:32 +0000 (2 18:51 -0400)
tree7de3649a2b48e36744aae72d5905bede2e28b6ca
parent6e86841d05f371b5b9b86ce76c02aaee83352298
ext4: Fix data corruption when writing to prealloc area

Inserting an extent can cause a new entry in the already existing index
block. That doesn't increase the depth of the instead. Instead it adds a
new leaf block. Now with the new leaf block the path information
corresponding to the logical block should be fetched from the new block.
The old path will be pointing to the old leaf block.

We need to recalucate the path information on extent insert
even if depth doesn't change. Without this change, the extent merge
after converting an unwritten extent to initialized extent takes the wrong
extent and cause data corruption.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c