Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bee63f40 authored by Nicholas Swenson's avatar Nicholas Swenson Committed by Kent Overstreet
Browse files

bcache: fix for gc crashing when no sectors are used

parent 97d11a66
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -184,7 +184,8 @@ static bool bucket_cmp(struct bucket *l, struct bucket *r)

static unsigned bucket_heap_top(struct cache *ca)
{
	return GC_SECTORS_USED(heap_peek(&ca->heap));
	struct bucket *b;
	return (b = heap_peek(&ca->heap)) ? GC_SECTORS_USED(b) : 0;
}

void bch_moving_gc(struct cache_set *c)