Skip to content

Commit

Permalink
ext4: error handling fix in ext4_ext_convert_to_initialized()
Browse files Browse the repository at this point in the history
When allocated is unsigned it breaks the error handling at the end
of the function when we call:
	allocated = ext4_split_extent(...);
	if (allocated < 0)
		err = allocated;

I've made it a signed int instead of unsigned.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Dan Carpenter authored and Theodore Ts'o committed Oct 26, 2011
1 parent 6654361 commit f85b287
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -2928,7 +2928,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
struct ext4_extent zero_ex;
struct ext4_extent *ex;
ext4_lblk_t ee_block, eof_block;
unsigned int allocated, ee_len, depth;
unsigned int ee_len, depth;
int allocated;
int err = 0;
int split_flag = 0;

Expand Down

0 comments on commit f85b287

Please sign in to comment.