13 Dec 2012 16:32
[PATCH] ext4: fix extent tree corruption that incurred by hole punch [V2]
Forrest Liu <forrestl <at> synology.com>
2012-12-13 15:32:22 GMT
2012-12-13 15:32:22 GMT
When depth of extent tree is greater than 1, logical start value
of interior node didn't updated correctly in ext4_ext_rm_idx.
Signed-off-by: Forrest Liu <forrestl <at> synology.com>
---
fs/ext4/extents.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d3dd618..496952e 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
<at> <at> -2190,13 +2190,14 <at> <at> errout:
* removes index from the index block.
*/
static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
- struct ext4_ext_path *path)
+ struct ext4_ext_path *path, int depth)
{
int err;
ext4_fsblk_t leaf;
/* free index block */
- path--;
+ depth--;
+ path = path + depth;
leaf = ext4_idx_pblock(path->p_idx);
if (unlikely(path->p_hdr->eh_entries == 0)) {
EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0");
<at> <at> -2221,6 +2222,19 <at> <at> static int ext4_ext_rm_idx(handle_t *handle,
(Continue reading)
RSS Feed