提交 b2f2c76d 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

[PATCH] ext4 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: NMingming Cao <cmm@us.ibm.com>
Signed-off-by: NHugh Dickins <hugh@veritas.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e7dc95db
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册