From: Hugh Dickins rsv_end is the last block within the reservation, so alloc_new_reservation should accept start_block == rsv_end as success. Signed-off-by: Hugh Dickins Cc: Martin Bligh Acked-by: Mingming Cao Signed-off-by: Andrew Morton --- fs/ext2/balloc.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN fs/ext2/balloc.c~ext2-balloc-fix-off-by-one-against-rsv_end fs/ext2/balloc.c --- a/fs/ext2/balloc.c~ext2-balloc-fix-off-by-one-against-rsv_end +++ a/fs/ext2/balloc.c @@ -950,7 +950,7 @@ retry: * 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 _