kernel_samsung_a53x/drivers/scsi
Johannes Thumshirn 7e989f7062 scsi: sd_zbc: Use kvzalloc() to allocate REPORT ZONES buffer
[ Upstream commit 7ce3e6107103214d354a16729a472f588be60572 ]

We have two reports of failed memory allocation in btrfs' code which is
calling into report zones.

Both of these reports have the following signature coming from
__vmalloc_area_node():

 kworker/u17:5: vmalloc error: size 0, failed to allocate pages, mode:0x10dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NORETRY|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0

Further debugging showed these where allocations of one sector (512
bytes) and at least one of the reporter's systems where low on memory,
so going through the overhead of allocating a vm area failed.

Switching the allocation from __vmalloc() to kvzalloc() avoids the
overhead of vmalloc() on small allocations and succeeds.

Note: the buffer is already freed using kvfree() so there's no need to
adjust the free path.

Cc: Qu Wenru <wqu@suse.com>
Cc: Naohiro Aota <naohiro.aota@wdc.com>
Link: https://github.com/kdave/btrfs-progs/issues/779
Link: https://github.com/kdave/btrfs-progs/issues/915
Fixes: 23a50861adda ("scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer()")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241030110253.11718-1-jth@kernel.org
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:23 +01:00
..
aacraid Revert "scsi: aacraid: Fix double-free on probe failure" 2024-11-24 00:23:49 +01:00
aic7xxx
aic94xx
arcmsr
arm
be2iscsi
bfa scsi: bfa: Ensure the copied buf is NUL terminated 2024-11-19 12:26:56 +01:00
bnx2fc scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload 2024-11-19 11:32:43 +01:00
bnx2i
csiostor
cxgbi
cxlflash
device_handler
dpt
esas2r
fcoe
fnic
hisi_sas
ibmvscsi
ibmvscsi_tgt
isci
libfc
libsas scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed 2024-11-19 14:19:50 +01:00
lpfc scsi: lpfc: Initialize status local variable in lpfc_sli4_repost_sgl_list() 2024-11-23 23:20:45 +01:00
megaraid
mpt3sas scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES 2024-11-23 23:20:28 +01:00
mvsas
pcmcia
pm8001
qedf scsi: qedf: Set qed_slowpath_params to zero before use 2024-11-19 14:19:46 +01:00
qedi scsi: qedi: Fix crash while reading debugfs attribute 2024-11-19 14:19:06 +01:00
qla2xxx scsi: qla2xxx: validate nvme_local_port correctly 2024-11-23 23:20:15 +01:00
qla4xxx
smartpqi
snic
sym53c8xx_2
ufs scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic 2024-11-23 23:20:28 +01:00
3w-9xxx.c
3w-9xxx.h
3w-sas.c
3w-sas.h
3w-xxxx.c
3w-xxxx.h
53c700.c
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c
aha1740.h
am53c974.c
atari_scsi.c
atp870u.c
atp870u.h
BusLogic.c
BusLogic.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c
dc395x.h
dmx3191d.c
dpt_i2o.c
dpti.h
esp_scsi.c
esp_scsi.h
fdomain.c
fdomain.h
fdomain_isa.c
fdomain_pci.c
FlashPoint.c
g_NCR5380.c
gdth.c
gdth.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c
gvp11.h
hosts.c scsi: core: Fix a use-after-free 2024-11-19 14:19:51 +01:00
hpsa.c scsi: hpsa: Fix allocation size for Scsi_Host private data 2024-11-19 12:26:55 +01:00
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c
imm.h
initio.c
initio.h
ipr.c
ipr.h
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c
iscsi_tcp.h
jazz_esp.c
Kconfig
lasi700.c
libiscsi.c
libiscsi_tcp.c
mac53c94.c
mac53c94.h
mac_esp.c
mac_scsi.c
Makefile
megaraid.c
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
myrb.c
myrb.h
myrs.c
myrs.h
ncr53c8xx.c
ncr53c8xx.h
NCR5380.c
NCR5380.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
pmcraid.c
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c
scsi.h
scsi_common.c
scsi_debug.c
scsi_debugfs.c
scsi_debugfs.h
scsi_devinfo.c
scsi_dh.c
scsi_error.c
scsi_ioctl.c
scsi_lib.c scsi: core: Fix a use-after-free 2024-11-19 14:19:51 +01:00
scsi_lib_dma.c
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h scsi: core: Fix a use-after-free 2024-11-19 14:19:51 +01:00
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c scsi: core: Fix a use-after-free 2024-11-19 14:19:51 +01:00
scsi_srpmb.c
scsi_srpmb.h
scsi_sysctl.c
scsi_sysfs.c scsi: core: Fix a use-after-free 2024-11-19 14:19:51 +01:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_iscsi.c
scsi_transport_sas.c
scsi_transport_spi.c scsi: spi: Fix sshdr use 2024-11-23 23:20:45 +01:00
scsi_transport_srp.c
scsicam.c
sd.c drivers: scsi: Reduce logspam 2024-11-19 17:47:00 +01:00
sd.h
sd_dif.c
sd_zbc.c scsi: sd_zbc: Use kvzalloc() to allocate REPORT ZONES buffer 2024-11-30 02:33:23 +01:00
sense_codes.h
ses.c
sg.c
sgiwd93.c
sim710.c
sni_53c710.c
sr.c
sr.h
sr_ioctl.c
sr_vendor.c
st.c
st.h
st_options.h
stex.c
storvsc_drv.c
sun3_scsi.c
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
virtio_scsi.c
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c
wd719x.h
xen-scsifront.c
zalon.c
zorro7xx.c
zorro_esp.c