Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331622
b: refs/heads/master
c: 6f2080e
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Oct 1, 2012
1 parent 7995a44 commit c8831c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02d262dffcf4c74e5c4612ee736bdb94f18ed5b9
refs/heads/master: 6f2080e64487b9963f9c6ff8a252e1abce98f2d4
16 changes: 9 additions & 7 deletions trunk/fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
struct ext4_ext_path *path = NULL;
ext4_fsblk_t partial_cluster = 0;
handle_t *handle;
int i = 0, err;
int i = 0, err = 0;

ext_debug("truncate since %u to %u\n", start, end);

Expand Down Expand Up @@ -2621,12 +2621,16 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
return PTR_ERR(path);
}
depth = ext_depth(inode);
/* Leaf not may not exist only if inode has no blocks at all */
ex = path[depth].p_ext;
if (!ex) {
ext4_ext_drop_refs(path);
kfree(path);
path = NULL;
goto cont;
if (depth) {
EXT4_ERROR_INODE(inode,
"path[%d].p_hdr == NULL",
depth);
err = -EIO;
}
goto out;
}

ee_block = le32_to_cpu(ex->ee_block);
Expand Down Expand Up @@ -2658,8 +2662,6 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
goto out;
}
}
cont:

/*
* We start scanning from right side, freeing all the blocks
* after i_size and walking into the tree depth-wise.
Expand Down

0 comments on commit c8831c1

Please sign in to comment.