summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorngkaho1234 <ngkaho1234@gmail.com>2016-02-04 15:39:00 +0000
committerngkaho1234 <ngkaho1234@gmail.com>2016-02-04 15:39:00 +0000
commit2eb1882c69281f7a101aed4c62df1f707fea9a6e (patch)
tree1b06e5d316f990d0b96553c91b342cefa513ef70 /src
parent3e94292dc3da4ee80c088bdbd108d5372dd4e1b5 (diff)
ext4_extent: return immediately when ext4_ext_correct_indexes fails.
Diffstat (limited to 'src')
-rw-r--r--src/ext4_extent.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ext4_extent.c b/src/ext4_extent.c
index f7fa68b..3c0085f 100644
--- a/src/ext4_extent.c
+++ b/src/ext4_extent.c
@@ -1424,12 +1424,15 @@ static int ext4_ext_remove_leaf(struct ext4_inode_ref *inode_ref,
eh->entries_count = to_le16(new_entries);
ext4_ext_dirty(inode_ref, path + depth);
- if (path[depth].extent == EXT_FIRST_EXTENT(eh) && eh->entries_count)
+ if (path[depth].extent == EXT_FIRST_EXTENT(eh) && eh->entries_count) {
err = ext4_ext_correct_indexes(inode_ref, path);
+ if (err != EOK)
+ return err;
+ }
/* if this leaf is free, then we should
* remove it from index block above */
- if (err == EOK && eh->entries_count == 0 && path[depth].block.lb_id)
+ if (eh->entries_count == 0 && path[depth].block.lb_id)
err = ext4_ext_remove_idx(inode_ref, path, depth - 1);
else if (depth > 0)
path[depth - 1].index++;