* [ext4] extent tree es_len can be zero?
@ 2013-04-30 4:59 Jon ERNST
2013-05-02 2:55 ` Zheng Liu
0 siblings, 1 reply; 2+ messages in thread
From: Jon ERNST @ 2013-04-30 4:59 UTC (permalink / raw)
To: linux-ext4
Hi ,list,
extent tree es_len can be zero?
if we call ext4_es_end when es_len is zero, it will have problem.
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 95796a1..49a8da2 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [ext4] extent tree es_len can be zero?
2013-04-30 4:59 [ext4] extent tree es_len can be zero? Jon ERNST
@ 2013-05-02 2:55 ` Zheng Liu
0 siblings, 0 replies; 2+ messages in thread
From: Zheng Liu @ 2013-05-02 2:55 UTC (permalink / raw)
To: Jon ERNST; +Cc: linux-ext4
On Tue, Apr 30, 2013 at 12:59:19AM -0400, Jon ERNST wrote:
> Hi ,list,
>
> extent tree es_len can be zero?
> if we call ext4_es_end when es_len is zero, it will have problem.
>
>
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index 95796a1..49a8da2 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -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);
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-02 2:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-30 4:59 [ext4] extent tree es_len can be zero? Jon ERNST
2013-05-02 2:55 ` Zheng Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).