linux-stable/drivers
Coly Li c954ac8d66 bcache: handle cache prio_buckets and disk_buckets properly for bucket size > 8MB
Similar to c->uuids, struct cache's prio_buckets and disk_buckets also
have the potential memory allocation failure during cache registration
if the bucket size > 8MB.

ca->prio_buckets can be stored on cache device in multiple buckets, its
in-memory space is allocated by kzalloc() interface but normally
allocated by alloc_pages() because the size > KMALLOC_MAX_CACHE_SIZE.

So allocation of ca->prio_buckets has the MAX_ORDER restriction too. If
the bucket size > 8MB, by default the page allocator will fail because
the page order > 11 (default MAX_ORDER value). ca->prio_buckets should
also use meta_bucket_bytes(), meta_bucket_pages() to decide its memory
size and use alloc_meta_bucket_pages() to allocate pages, to avoid the
allocation failure during cache set registration when bucket size > 8MB.

ca->disk_buckets is a single bucket size memory buffer, it is used to
iterate each bucket of ca->prio_buckets, and compose the bio based on
memory of ca->disk_buckets, then write ca->disk_buckets memory to cache
disk one-by-one for each bucket of ca->prio_buckets. ca->disk_buckets
should have in-memory size exact to the meta_bucket_pages(), this is the
size that ca->prio_buckets will be stored into each on-disk bucket.

This patch fixes the above issues and handle cache's prio_buckets and
disk_buckets properly for bucket size larger than 8MB.

Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-25 07:38:20 -06:00
..
accessibility
acpi Merge branch 'acpi-fan' 2020-07-03 16:15:31 +02:00
amba ARM: tegra: Replace zero-length array with flexible-array 2020-06-15 23:08:28 -05:00
android binder: fix null deref of proc->context 2020-06-23 07:54:46 +02:00
ata libata-5.8-2020-06-19 2020-06-19 13:09:40 -07:00
atm
auxdisplay
base Power management fixes for 5.8-rc3 2020-06-26 12:32:11 -07:00
bcma
block rsxx: switch from 'pci_free_consistent()' to 'dma_free_coherent()' 2020-07-11 09:27:09 -06:00
bluetooth
bus Fixes for omaps for v5.8 2020-06-28 14:41:55 +02:00
cdrom
char tpm_tis: Remove the HID IFX0102 2020-07-02 17:49:00 +03:00
clk clk: sifive: allocate sufficient memory for struct __prci_data 2020-06-25 15:04:13 -07:00
clocksource
connector
counter
cpufreq cpufreq: intel_pstate: Add one more OOB control bit 2020-06-23 17:24:32 +02:00
cpuidle cpuidle: Rearrange s2idle-specific idle state entry code 2020-06-25 13:52:53 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-06-21 10:01:03 -07:00
dax block: remove the bd_queue field from struct block_device 2020-07-01 08:08:20 -06:00
dca
devfreq
dio maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
dma dmaengine: tegra-apb: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
dma-buf dma-buf: Move dma_buf_release() from fops to dentry_ops 2020-06-25 16:05:40 +05:30
edac EDAC/amd64: Read back the scrub rate PCI register on F15h 2020-06-18 20:25:25 +02:00
eisa
extcon
firewire firewire: ohci: Replace zero-length array with flexible-array 2020-06-15 23:08:31 -05:00
firmware ARM: SoC fixes for v5.8 2020-06-28 14:55:18 -07:00
fpga FPGA Manager fixes for 5.8-rc1 2020-06-26 17:26:31 +02:00
fsi
gnss
gpio
gpu * dma-buf: fix a use-after-free bug 2020-07-03 11:18:21 +10:00
greybus
hid
hsi
hv Drivers: hv: Change flag to write log level in panic msg to false 2020-06-29 10:30:35 +00:00
hwmon hwmon: (pmbus) fix a typo in Kconfig SENSORS_IR35221 option 2020-07-02 17:43:14 -07:00
hwspinlock
hwtracing stm class: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
i2c i2c: mlxcpld: check correct size of maximum RECV_LEN packet 2020-07-04 08:20:38 +02:00
i3c
ide
idle
iio
infiniband IB/hfi1: Add atomic triggered sleep/wakeup 2020-06-24 16:13:38 -03:00
input maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
interconnect
iommu iommu/vt-d: Fix misuse of iommu_domain_identity_map() 2020-06-23 10:08:32 +02:00
ipack
irqchip irqchip/gic: Atomically update affinity 2020-06-21 15:24:46 +01:00
isdn
leds
lightnvm block: rename generic_make_request to submit_bio_noacct 2020-07-01 07:27:24 -06:00
macintosh
mailbox
mcb
md bcache: handle cache prio_buckets and disk_buckets properly for bucket size > 8MB 2020-07-25 07:38:20 -06:00
media media: omap3isp: remove cacheflush.h 2020-06-26 00:27:37 -07:00
memory
memstick
message scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations 2020-06-26 22:51:53 -04:00
mfd mfd: mt6360: Fix register driver NULL pointer by adding driver name 2020-06-16 09:32:43 +01:00
misc habanalabs: increase h/w timer when checking idle 2020-06-24 12:35:23 +03:00
mmc blk-mq: move failure injection out of blk_mq_complete_request 2020-06-24 09:15:57 -06:00
most
mtd
mux
net wil6210: account for napi_gro_receive never returning GRO_DROP 2020-06-25 16:16:21 -07:00
nfc
ntb
nubus
nvdimm block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
nvme block: add max_active_zones to blk-sysfs 2020-07-15 14:26:11 -06:00
nvmem
of of: of_mdio: Correct loop scanning logic 2020-06-19 13:39:00 -07:00
opp
oprofile oprofile: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
parisc
parport
pci Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
pcmcia
perf
phy phy: samsung: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
pinctrl pinctrl: single: fix function name in documentation 2020-06-20 22:41:32 +02:00
platform Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
pnp
power
powercap Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
pps
ps3
ptp
pwm
rapidio rapidio: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
ras
regulator regulator: mt6358: Remove BROKEN dependency 2020-06-17 13:01:19 +01:00
remoteproc
reset
rpmsg
rtc
s390 s390/dasd: Use struct_size() helper 2020-07-15 08:47:11 -06:00
sbus
scsi block: add max_active_zones to blk-sysfs 2020-07-15 14:26:11 -06:00
sfi
sh
siox
slimbus
soc ARM: OMAP fixes for v5.8 2020-06-28 14:57:14 -07:00
soundwire
spi spi: Fixes for v5.8 2020-06-29 10:10:16 -07:00
spmi
ssb
staging Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() 2020-06-16 21:25:38 +02:00
target Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
tc
tee
thermal thermal/drivers/rcar_gen3: Fix undefined temperature if negative 2020-06-29 12:15:34 +02:00
thunderbolt
tty Linux 5.8-rc4 2020-07-08 08:02:13 -06:00
uio
usb USB fixes for 5.8-rc3 2020-06-27 13:12:10 -07:00
vdpa vdpa: fix typos in the comments for __vdpa_alloc_device() 2020-06-22 12:34:21 -04:00
vfio vfio/pci: Fix SR-IOV VF handling with MMIO blocking 2020-06-25 11:04:23 -06:00
vhost tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
video Short summary of fixes pull (less than what git shortlog provides): 2020-06-26 13:49:17 +10:00
virt
virtio virtio-mem: add memory via add_memory_driver_managed() 2020-06-22 12:34:21 -04:00
visorbus
vlynq
vme
w1 w1: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
watchdog
xen xen: branch for v5.8-rc4 2020-07-03 23:58:12 -07:00
zorro
Kconfig
Makefile