aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 3a7aed7282b2..643c3021624f 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -708,16 +708,15 @@ static void cached_dev_read_error(struct closure *cl)
708{ 708{
709 struct search *s = container_of(cl, struct search, cl); 709 struct search *s = container_of(cl, struct search, cl);
710 struct bio *bio = &s->bio.bio; 710 struct bio *bio = &s->bio.bio;
711 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk);
712 711
713 /* 712 /*
714 * If cache device is dirty (dc->has_dirty is non-zero), then 713 * If read request hit dirty data (s->read_dirty_data is true),
715 * recovery a failed read request from cached device may get a 714 * then recovery a failed read request from cached device may
716 * stale data back. So read failure recovery is only permitted 715 * get a stale data back. So read failure recovery is only
717 * when cache device is clean. 716 * permitted when read request hit clean data in cache device,
717 * or when cache read race happened.
718 */ 718 */
719 if (s->recoverable && 719 if (s->recoverable && !s->read_dirty_data) {
720 (dc && !atomic_read(&dc->has_dirty))) {
721 /* Retry from the backing device: */ 720 /* Retry from the backing device: */
722 trace_bcache_read_retry(s->orig_bio); 721 trace_bcache_read_retry(s->orig_bio);
723 722