• Kent Overstreet's avatar
    bcache: Data corruption fix · f4ac67e8
    Kent Overstreet authored
    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: default avatarKent Overstreet <kmo@daterainc.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f4ac67e8
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
alloc.c Loading commit data...
bcache.h Loading commit data...
bset.c Loading commit data...
bset.h Loading commit data...
btree.c Loading commit data...
btree.h Loading commit data...
closure.c Loading commit data...
closure.h Loading commit data...
debug.c Loading commit data...
debug.h Loading commit data...
io.c Loading commit data...
journal.c Loading commit data...
journal.h Loading commit data...
movinggc.c Loading commit data...
request.c Loading commit data...
request.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
super.c Loading commit data...
sysfs.c Loading commit data...
sysfs.h Loading commit data...
trace.c Loading commit data...
util.c Loading commit data...
util.h Loading commit data...
writeback.c Loading commit data...