Message ID | eaeaf505-92b1-7d45-9b42-64f9d3f05e0b@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 681b4f12b05a..f397785d9c38 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -697,8 +697,10 @@ static void cached_dev_read_error(struct closure *cl) { struct search *s = container_of(cl, struct search, cl); struct bio *bio = &s->bio.bio; + struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); - if (s->recoverable) { + if (s->recoverable && + (dc && !atomic_read(&dc->has_dirty)) { /* Retry from the backing device: */ trace_bcache_read_retry(s->orig_bio);