Skip to contentSkip to conversation

bcache: fix cache miss's issue

PATCH In review Qiang Bai 2 participants 2 messages Jun 27, 2021 – Jun 28, 2021 bcache (block layer cache)

lore
Share & tools
lore

Qiang Bai

author
#0 lore raw

PATCH 1/1 bcache: fix cache miss's issue

when cache miss's IO was done, it needs to continue the left part of IO, not return -EINTR. -EINTR will stop the whole btree recurse.

---
 drivers/md/bcache/request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/request.c +1 -1
index 29c231758293..b6ff101d2611 100644
@@ -914,7 +914,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s,
 	miss = bio_next_split(bio, sectors, GFP_NOIO, &s->d->bio_split);
 
 	/* btree_search_recurse()'s btree iterator is no good anymore */
-	ret = miss == bio ? MAP_DONE : -EINTR;
+	ret = miss == bio ? MAP_DONE : MAP_CONTINUE;
 
 	cache_bio = bio_alloc_bioset(GFP_NOWAIT,
 			DIV_ROUND_UP(s->insert_bio_sectors, PAGE_SECTORS),
Signature · 1 line
2.31.1
#1 lore raw
Quoted 4 lines · Qiang Bai

when cache miss's IO was done, it needs to continue the left part of IO, not return -EINTR. -EINTR will stop the whole btree recurse.

NACK.  The commit log should explain how the fixing issue happens in detail, and why your method fixes it.

Thanks.

Coly Li

Quoted 17 lines
---
 drivers/md/bcache/request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/request.c +1 -1
index 29c231758293..b6ff101d2611 100644
@@ -914,7 +914,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s,
 	miss = bio_next_split(bio, sectors, GFP_NOIO, &s->d->bio_split);
 
 	/* btree_search_recurse()'s btree iterator is no good anymore */
-	ret = miss == bio ? MAP_DONE : -EINTR;
+	ret = miss == bio ? MAP_DONE : MAP_CONTINUE;
 
 	cache_bio = bio_alloc_bioset(GFP_NOWAIT,
 			DIV_ROUND_UP(s->insert_bio_sectors, PAGE_SECTORS),