]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bcache: fix miss key refill->end in writeback
authorTang Junhui <tang.junhui.linux@gmail.com>
Mon, 8 Oct 2018 12:41:14 +0000 (20:41 +0800)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:56:11 +0000 (19:56 -0600)
commit12469dbdf829a7747357c5a32968ec54306ce424
treea5a40fb65196a06e28f97d9296a7bf114627de98
parent062d75ed20d6ae5f2f3700e49e709adc3a4fc70c
bcache: fix miss key refill->end in writeback

BugLink: https://bugs.launchpad.net/bugs/1836802
commit 2d6cb6edd2c7fb4f40998895bda45006281b1ac5 upstream.

refill->end record the last key of writeback, for example, at the first
time, keys (1,128K) to (1,1024K) are flush to the backend device, but
the end key (1,1024K) is not included, since the bellow code:
if (bkey_cmp(k, refill->end) >= 0) {
ret = MAP_DONE;
goto out;
}
And in the next time when we refill writeback keybuf again, we searched
key start from (1,1024K), and got a key bigger than it, so the key
(1,1024K) missed.
This patch modify the above code, and let the end key to be included to
the writeback key buffer.

Signed-off-by: Tang Junhui <tang.junhui.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/md/bcache/btree.c