Re: [PATCH v2] ext4: avoid eh_entries overflow before insert extent_idx
From: Coly Li <hidden>
Date: 2011-06-23 16:49:47
On 2011年06月23日 17:00, Yongqiang Yang Wrote:
On Thu, Jun 23, 2011 at 4:47 PM, Robin Dong [off-list ref] wrote:quoted
If eh_entries is equal to (or greater than) eh_max, the operation of inserting new extent_idx will make number of entries overflow. So check eh_entries before inserting the new extent_idx. Signed-off-by: Robin Dong <redacted> --- �fs/ext4/extents.c | � 18 ++++++++++-------- �1 files changed, 10 insertions(+), 8 deletions(-)diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index eb63c7b..792e77e 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c
[snip]
quoted
� � � �if (unlikely(ix > EXT_LAST_INDEX(curp->p_hdr))) {condition ix > EXT_LAST_INDEX(curp->p_hdr) can not be true. Right? May be we can remove this if-statement in this patch. Yongqiang.
[snip] Good suggestion. But I suggest us to remove it a little bit later. When we do meta data checksum, the last index/extent record might be used for checksum, the above checking might still be helpful for bug probing. Thanks. Coly -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html