Skip to content

Commit

Permalink
[PATCH] ext4 balloc: fix off-by-one against rsv_end
Browse files Browse the repository at this point in the history
rsv_end is the last block within the reservation, so alloc_new_reservation
should accept start_block == rsv_end as success.

Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Dec 7, 2006
1 parent e7dc95d commit b2f2c76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ static int alloc_new_reservation(struct ext4_reserve_window_node *my_rsv,
* check if the first free block is within the
* free space we just reserved
*/
if (start_block >= my_rsv->rsv_start && start_block < my_rsv->rsv_end)
if (start_block >= my_rsv->rsv_start && start_block <= my_rsv->rsv_end)
return 0; /* success */
/*
* if the first free bit we found is out of the reservable space
Expand Down

0 comments on commit b2f2c76

Please sign in to comment.