This can happen at the end of a cleaner segment, and in
general it is best to be cautious. So if the next pointer
isn't further along in this segment, don't follow it.
Signed-off-by: NeilBrown <neilb@suse.de>
/* Finished with that cluster, try another. */
u64 next;
next = le64_to_cpu(tc->ch->next_addr);
- if (in_seg(fs, tc->dev, tc->seg, next)) {
- BUG_ON(next <= tc->haddr);
+ if (next > tc->haddr &&
+ in_seg(fs, tc->dev, tc->seg, next)) {
tc->haddr = next;
tc->ac.state = 1;
} else {