Skip to content

Commit e52ad8e

Browse files
Tang Junhuigregkh
authored andcommitted
bcache: fix miss key refill->end in writeback
commit 2d6cb6e 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 <[email protected]> Cc: [email protected] Signed-off-by: Coly Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9e9f19e commit e52ad8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/bcache/btree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ static int refill_keybuf_fn(struct btree_op *op, struct btree *b,
24342434
struct keybuf *buf = refill->buf;
24352435
int ret = MAP_CONTINUE;
24362436

2437-
if (bkey_cmp(k, refill->end) >= 0) {
2437+
if (bkey_cmp(k, refill->end) > 0) {
24382438
ret = MAP_DONE;
24392439
goto out;
24402440
}

0 commit comments

Comments
 (0)