android_kernel_samsung_msm8976/drivers/md/bcache
Kent Overstreet f4ac67e8e7 bcache: Data corruption fix
commit ef71ec00002d92a08eb27e9d036e3d48835b6597 upstream.

The code that handles overlapping extents that we've just read back in from disk
was depending on the behaviour of the code that handles overlapping extents as
we're inserting into a btree node in the case of an insert that forced an
existing extent to be split: on insert, if we had to split we'd also insert a
new extent to represent the top part of the old extent - and then that new
extent would get written out.

The code that read the extents back in thus not bother with splitting extents -
if it saw an extent that ovelapped in the middle of an older extent, it would
trim the old extent to only represent the bottom part, assuming that the
original insert would've inserted a new extent to represent the top part.

I still haven't figured out _how_ it can happen, but I'm now pretty convinced
(and testing has confirmed) that there's some kind of an obscure corner case
(probably involving extent merging, and multiple overwrites in different sets)
that breaks this. The fix is to change the mergesort fixup code to split extents
itself when required.

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-06 11:08:16 -08:00
..
alloc.c bcache: Allocator cleanup/fixes 2013-04-30 19:14:40 -07:00
bcache.h bcache: Fix a writeback performance regression 2013-10-05 07:13:09 -07:00
bset.c bcache: Data corruption fix 2014-02-06 11:08:16 -08:00
bset.h
btree.c bcache: Fix a shrinker deadlock 2013-10-05 07:13:09 -07:00
btree.h
closure.c bcache: Fix a dumb race 2013-07-28 16:30:09 -07:00
closure.h
debug.c bcache: Disable broken btree fuzz tester 2013-04-08 13:33:49 -07:00
debug.h
io.c md: bcache: io.c: fix a potential NULL pointer dereference 2013-08-29 09:47:40 -07:00
journal.c bcache: Fix a flush/fua performance bug 2013-10-05 07:13:09 -07:00
journal.h
Kconfig bcache: drop "select CLOSURES" 2013-05-15 00:42:51 -07:00
Makefile
movinggc.c bcache: Don't export utility code, prefix with bch_ 2013-03-28 12:50:55 -06:00
request.c bcache: Fixed incorrect order of arguments to bio_alloc_bioset() 2013-11-13 12:05:30 +09:00
request.h
stats.c bcache: Fix error handling in init code 2013-05-15 00:48:14 -07:00
stats.h
super.c bcache: Fix a sysfs splat on shutdown 2013-07-28 16:30:10 -07:00
sysfs.c bcache: Strip endline when writing the label through sysfs 2013-10-05 07:13:09 -07:00
sysfs.h bcache: Don't export utility code, prefix with bch_ 2013-03-28 12:50:55 -06:00
trace.c
util.c bcache: Fix a writeback performance regression 2013-10-05 07:13:09 -07:00
util.h bcache: Fix a writeback performance regression 2013-10-05 07:13:09 -07:00
writeback.c bcache: Fix a dumb CPU spinning bug in writeback 2013-10-05 07:13:09 -07:00