]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: Fix GC_SECTORS_USED() calculation
authorKent Overstreet <kmo@daterainc.com>
Fri, 12 Jul 2013 02:43:21 +0000 (19:43 -0700)
committerKent Overstreet <kmo@daterainc.com>
Fri, 12 Jul 2013 07:22:48 +0000 (00:22 -0700)
commit7884c205328ed9b2da9d5f09f0b376e0576822e0
treec5d9e433cff6b0ab4ea779bd6ff16bfe6c01cae0
parentfe7fa2d5bfd212eabb753b898880130872e7aa32
bcache: Fix GC_SECTORS_USED() calculation

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: Kent Overstreet <kmo@daterainc.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.10
drivers/md/bcache/btree.c