extent tree es_len can be zero?
Hi ,list,
extent tree es_len can be zero?
if we call ext4_es_end when es_len is zero, it will have problem.
fs/ext4/extents_status.c +2 -3
@@ -108,7 +108,7 @@ * tree are ordered by logical block no. * * -- operations on a extent status tree - * There are three important operations on a delayed extent tree: find + * There are three important operations on a delayed extent tree: finding * next extent, adding a extent(a range of blocks) and removing a extent. * * -- race on a extent status tree
@@ -195,7 +195,7 @@ static void ext4_es_print_tree(struct inode *inode)static inline ext4_lblk_t ext4_es_end (struct extent_status *es) { - BUG_ON(es->es_lblk + es->es_len < es->es_lblk); + BUG_ON(es->es_lblk + es->es_len <= es->es_lblk); return es->es_lblk + es->es_len - 1; } --
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 20 lines · Jon ERNST
Hi ,list,
extent tree
es_lencan be zero?
if we callext4_es_endwhenes_lenis zero, it will have problem.fs/ext4/extents_status.c +1
-1@@ -108,7 +108,7 @@ * tree are ordered by logical block no. * * -- operations on a extent status tree - * There are three important operations on a delayed extent tree: find + * There are three important operations on a delayed extent tree: finding * next extent, adding a extent(a range of blocks) and removing a extent. * * -- race on a extent status tree
fs/ext4/extents_status.c static void ext4_es_print_tree(struct inode *inode) · line 198
Quoted 5 lines
fs/ext4/extents_status.c +1
-1@@ -195,7 +195,7 @@ static void ext4_es_print_tree(struct inode *inode)static inline ext4_lblk_t ext4_es_end (struct extent_status *es) { - BUG_ON(es->es_lblk + es->es_len < es->es_lblk); + BUG_ON(es->es_lblk + es->es_len <= es->es_lblk);
Hi Jon,
Thanks for looking at the code. When ext4_es_end is called, es_len shouldn't be zero because we always get 'es' from extent status tree, and we never save an 'es' whose length is zero. So we don't need to worry about this.
Regards,
- Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html