diff options
| author | 2017-12-18 09:08:05 +0100 | |
|---|---|---|
| committer | 2017-12-18 09:08:05 +0100 | |
| commit | d9e3d899bc7a852d44b3305ed49799fbf090e756 (patch) | |
| tree | f3a75cb5f60be908a4384bd9e7add08486d7d338 /drivers/md/bcache/request.c | |
| parent | usb: usbtest: Add TEST 29, toggle sync, Clear toggle between bulk writes (diff) | |
| parent | Linux 4.15-rc4 (diff) | |
| download | wireguard-linux-d9e3d899bc7a852d44b3305ed49799fbf090e756.tar.xz wireguard-linux-d9e3d899bc7a852d44b3305ed49799fbf090e756.zip | |
Merge 4.15-rc4 into usb-next
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/bcache/request.c')
| -rw-r--r-- | drivers/md/bcache/request.c | 13 |
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) { 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 cache device is dirty (dc->has_dirty is non-zero), then - * recovery a failed read request from cached device may get a - * stale data back. So read failure recovery is only permitted - * when cache device is clean. + * If read request hit dirty data (s->read_dirty_data is true), + * then recovery a failed read request from cached device may + * get a stale data back. So read failure recovery is only + * permitted when read request hit clean data in cache device, + * or when cache read race happened. */ - if (s->recoverable && - (dc && !atomic_read(&dc->has_dirty))) { + if (s->recoverable && !s->read_dirty_data) { /* Retry from the backing device: */ trace_bcache_read_retry(s->orig_bio); |
