summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTang Junhui <tang.junhui.linux@gmail.com>2018-10-08 20:41:14 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-13 11:14:45 -0800
commitdcd048d6bb08d3da1e9cb1923bce80dbc0f90fed (patch)
tree41f67de50c84bfa2854067998034f2411b7c9b66
parent82239bda9dac002ffb68c6019134c5245aeb4cae (diff)
downloadlinux-stable-dcd048d6bb08d3da1e9cb1923bce80dbc0f90fed.tar.gz
linux-stable-dcd048d6bb08d3da1e9cb1923bce80dbc0f90fed.tar.bz2
linux-stable-dcd048d6bb08d3da1e9cb1923bce80dbc0f90fed.zip
bcache: fix miss key refill->end in writeback
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>
-rw-r--r--drivers/md/bcache/btree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 89d088cf95d9..9406326216f1 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -2371,7 +2371,7 @@ static int refill_keybuf_fn(struct btree_op *op, struct btree *b,
struct keybuf *buf = refill->buf;
int ret = MAP_CONTINUE;
- if (bkey_cmp(k, refill->end) >= 0) {
+ if (bkey_cmp(k, refill->end) > 0) {
ret = MAP_DONE;
goto out;
}