Skip to contentSkip to conversation

master - bcache: nr_ios_pending wasn't being incremented

PATCH Joe Thornber 1 participant 1 message May 16, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=df2acbbb97dbda000053afd40d2e4a707e226b52
Commit:        df2acbbb97dbda000053afd40d2e4a707e226b52
Parent:        413488edc6dd077e79517e44a8d3b9a51c5138e5
Author:        Joe Thornber <[email protected]>
AuthorDate:    Wed May 16 10:09:17 2018 +0100
Committer:     Joe Thornber <[email protected]>
CommitterDate: Wed May 16 10:09:17 2018 +0100

bcache: nr_ios_pending wasn't being incremented

... but it was being decremented on completion. Which meant it wrapped, and no prefetches were ever issued after the first completion.

---
 lib/device/bcache.c  |    1 +
 test/unit/bcache_t.c |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)
lib/device/bcache.c +1 -0
index 9085d87..652441f 100644
@@ -667,6 +667,7 @@ static void _issue_low_level(struct block *b, enum dir d)
 
 	b->io_dir = d;
 	_set_flags(b, BF_IO_PENDING);
+	cache->nr_io_pending++;
 
 	dm_list_move(&cache->io_pending, &b->list);
 
test/unit/bcache_t.c +44 -1

63 lines not on this page · raw message