linux-kernelorg-stable/drivers
Rui Hua b221fc130c bcache: ret IOERR when read meets metadata error
The read request might meet error when searching the btree, but the error
was not handled in cache_lookup(), and this kind of metadata failure will
not go into cached_dev_read_error(), finally, the upper layer will receive
bi_status=0.  In this patch we judge the metadata error by the return
value of bch_btree_map_keys(), there are two potential paths give rise to
the error:

1. Because the btree is not totally cached in memery, we maybe get error
   when read btree node from cache device (see bch_btree_node_get()), the
   likely errno is -EIO, -ENOMEM

2. When read miss happens, bch_btree_insert_check_key() will be called to
   insert a "replace_key" to btree(see cached_dev_cache_miss(), just for
   doing preparatory work before insert the missed data to cache device),
   a failure can also happen in this situation, the likely errno is
   -ENOMEM

bch_btree_map_keys() will return MAP_DONE in normal scenario, but we will
get either -EIO or -ENOMEM in above two cases. if this happened, we should
NOT recover data from backing device (when cache device is dirty) because
we don't know whether bkeys the read request covered are all clean.  And
after that happened, s->iop.status is still its initially value(0) before
we submit s->bio.bio, we set it to BLK_STS_IOERR, so it can go into
cached_dev_read_error(), and finally it can be passed to upper layer, or
recovered by reread from backing device.

[edit by mlyle: patch formatting, word-wrap, comment spelling,
commit log format]

Signed-off-by: Hua Rui <huarui.dev@gmail.com>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-01-08 13:29:00 -07:00
..
accessibility
acpi PM / sleep: Avoid excess pm_runtime_enable() calls in device_resume() 2017-12-11 14:32:56 +01:00
amba
android
ata libata: sata_down_spd_limit should return if driver has not recorded sstatus speed 2017-12-04 13:57:03 -08:00
atm
auxdisplay
base PM / sleep: Avoid excess pm_runtime_enable() calls in device_resume() 2017-12-11 14:32:56 +01:00
bcma
block DAC960: split up ioctl function to reduce stack size 2018-01-06 09:18:00 -07:00
bluetooth
bus bus: arm-ccn: fix module unloading Error: Removing state 147 which has instances left. 2017-12-04 17:15:20 +00:00
cdrom
char The big changes for IPMI that just went in had a few problems. These 2017-12-11 17:01:59 -08:00
clk
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma dmaengine: fsl-edma: disable clks on all error paths 2017-12-15 09:53:04 +05:30
dma-buf
edac
eisa
extcon
firewire
firmware ARM: SoC fixes for 4.15-rc 2017-12-10 08:26:59 -08:00
fmc
fpga
fsi
gpio gpio: pca953x: fix vendor prefix for PCA9654 2017-12-02 22:41:43 +01:00
gpu Merge branch 'akpm' (patches from Andrew) 2017-12-14 16:35:20 -08:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing tracing: Pass export pointer as argument to ->write() 2017-12-04 07:14:30 -05:00
i2c i2c: piix4: Fix port number check on release 2017-12-12 23:27:04 +01:00
ide
idle
iio iio: health: max30102: Temperature should be in milli Celsius 2017-12-02 11:15:14 +00:00
infiniband Second pull request for 4.15-rc 2017-12-16 13:43:08 -08:00
input
iommu IOMMU fixes for Linux v4.15-rc3 2017-12-06 10:53:02 -08:00
ipack
irqchip
isdn
leds
lightnvm lightnvm: pblk: refactor pblk_ppa_comp function 2018-01-05 08:50:12 -07:00
macintosh
mailbox
mcb
md bcache: ret IOERR when read meets metadata error 2018-01-08 13:29:00 -07:00
media media fixes for v4.15-rc3 2017-12-08 13:18:47 -08:00
memory
memstick
message
mfd
misc Merge branch 'WIP.x86-pti.base.prep-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-12-17 13:54:31 -08:00
mmc mmc: core: apply NO_CMD23 quirk to some specific cards 2017-12-11 13:43:27 +01:00
mtd
mux
net net: qcom/emac: Reduce timeout for mdio read/write 2017-12-15 15:46:19 -05:00
nfc
ntb
nubus
nvdimm
nvme nvme: fix subsystem multiple controllers support check 2018-01-08 16:57:00 +01:00
nvmem
of of_mdio / mdiobus: ensure mdio devices have fwnode correctly populated 2017-12-13 15:01:47 -05:00
opp
oprofile
parisc
parport
pci Power management fix for v4.15-rc4 2017-12-14 18:25:03 -08:00
pcmcia
perf
phy
pinctrl
platform platform/x86: dell-wmi: check for kmalloc() errors 2017-12-11 17:26:03 -08:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 s390/qeth: update takeover IPs after configuration change 2017-12-15 11:29:43 -05:00
sbus
scsi SCSI fixes on 20171215 2017-12-15 12:51:42 -08:00
sfi
sh
sn
soc
spi
spmi
ssb
staging Merge tag 'staging-4.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging 2017-12-15 12:59:48 -08:00
target target: Use sgl_alloc_order() and sgl_free() 2018-01-06 09:18:00 -07:00
tc
tee
thermal
thunderbolt
tty
uio
usb USB: core: prevent malicious bNumInterfaces overflow 2017-12-13 12:28:43 +01:00
uwb
vfio
vhost vhost: fix skb leak in handle_rx() 2017-12-02 21:31:03 -05:00
video
virt
virtio virtio_mmio: fix devm cleanup 2017-12-14 21:01:40 +02:00
vlynq
vme
w1
watchdog
xen xen: fixes for 4.15-rc4 2017-12-15 11:32:09 -08:00
zorro
Kconfig
Makefile