From: Hugh Dickins Date: Thu, 7 Dec 2006 04:41:25 +0000 (-0800) Subject: [PATCH] ext3 balloc: fix off-by-one against rsv_end X-Git-Tag: v2.6.20-rc1~145^2^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ff50dc562bf6de00fec264b11531e2745209ba12;p=linux-2.6-omap-h63xx.git [PATCH] ext3 balloc: fix off-by-one against rsv_end 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 Signed-off-by: Hugh Dickins Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index 0706a45d3c0..57cf47a9420 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -1148,7 +1148,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