mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-19 06:26:28 +00:00
scoutfs: fix next ival busy loop
The next interval interface didn't set the ival to return to null when it finds a null next node. The caller would continuously get the same interval. This is what I get for programming late at night, I guess. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+6
-7
@@ -135,14 +135,13 @@ struct scoutfs_ival *scoutfs_next_ival(struct scoutfs_ival_tree *tree,
|
||||
if (!ival)
|
||||
return first_ival(tree, start, end);
|
||||
|
||||
while ((node = rb_next(&ival->node))) {
|
||||
node = rb_next(&ival->node);
|
||||
if (node) {
|
||||
ival = container_of(node, struct scoutfs_ival, node);
|
||||
|
||||
if (scoutfs_cmp_key_ranges(start, end,
|
||||
&ival->start, &ival->end))
|
||||
ival = NULL;
|
||||
break;
|
||||
if (!scoutfs_cmp_key_ranges(start, end,
|
||||
&ival->start, &ival->end))
|
||||
return ival;
|
||||
}
|
||||
|
||||
return ival;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user