• Kent Overstreet's avatar
    bcache: Fix GC_SECTORS_USED() calculation · 29ebf465
    Kent Overstreet authored
    Part of the job of garbage collection is to add up however many sectors
    of live data it finds in each bucket, but that doesn't work very well if
    it doesn't reset GC_SECTORS_USED() when it starts. Whoops.
    
    This wouldn't have broken anything horribly, but allocation tries to
    preferentially reclaim buckets that are mostly empty and that's not
    gonna work with an incorrect GC_SECTORS_USED() value.
    Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
    Cc: linux-stable <stable@vger.kernel.org> # >= v3.10
    29ebf465
btree.c 55.4 KB