linux/drivers/ata
Damien Le Moal 5251ae224d ata: libata-scsi: Return residual for emulated SCSI commands
The function ata_scsi_rbuf_fill() used to fill the reply buffer of
emulated SCSI commands always copies the ATA reply buffer
(ata_scsi_rbuf) up to the size of the SCSI command buffer (the transfer
length for the command), even if the reply is shorter than the SCSI
command buffer. This leads to issuers of the SCSI command to always get
a result without any residual (resid is always 0) despite the
potentially shorter reply for the command.

Modify all fill actors used by ata_scsi_rbuf_fill() to return the number
of bytes filled for the reply and 0 in case of error. Using this value,
add a call to scsi_set_resid() in ata_scsi_rbuf_fill() to set the
correct residual for the SCSI command when the reply length is shorter
than the command buffer.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20241022024537.251905-7-dlemoal@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
2024-10-25 10:09:49 +02:00
..
pata_parport parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
acard-ahci.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
ahci_brcm.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_ceva.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_da850.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_dm816.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_dwc.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_imx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_mtk.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_mvebu.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_octeon.c ata: ahci_octeon: Convert to devm_platform_ioremap_resource() 2023-08-02 17:37:06 +09:00
ahci_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_qoriq.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_seattle.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_st.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_sunxi.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_tegra.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci_xgene.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
ahci.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
ahci.h scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
ata_generic.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
ata_piix.c ata: ata_piix: Remove useless comment in piix_init_sidpr() 2024-07-30 07:10:25 +09:00
Kconfig ata: Kconfig: Update SATA_MOBILE_LPM_POLICY default to med_power_with_dipm 2024-05-27 11:34:50 +02:00
libahci_platform.c ata: libahci_platform: Simplify code with for_each_child_of_node_scoped() 2024-08-15 13:30:06 +02:00
libahci.c ata: libata-core: Set ATA_QCFLAG_RTF_FILLED in fill_result_tf() 2024-07-03 10:51:41 +02:00
libata-acpi.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
libata-core.c ata changes for 6.12 2024-09-19 09:49:10 +02:00
libata-eh.c ata: libata: Clear DID_TIME_OUT for ATA PT commands with sense data 2024-09-11 08:03:43 +09:00
libata-pata-timings.c
libata-pmp.c ata: libata: Move sector_buf from struct ata_port to struct ata_device 2024-09-07 10:16:55 +09:00
libata-sata.c ata: libata: Improve CDL resource management 2024-09-07 10:16:56 +09:00
libata-scsi.c ata: libata-scsi: Return residual for emulated SCSI commands 2024-10-25 10:09:49 +02:00
libata-sff.c ata: libata: Remove ata_noop_qc_prep() 2024-08-02 09:18:42 +09:00
libata-trace.c ata: scsi: rename flag ATA_QCFLAG_FAILED to ATA_QCFLAG_EH 2023-01-04 13:36:26 +09:00
libata-transport.c ata: libata: Fix W=1 compilation warning 2024-09-07 11:02:52 +09:00
libata-transport.h ata,scsi: Remove wrappers ata_sas_tport_{add,delete}() 2024-07-04 11:52:31 +02:00
libata-zpodd.c ata: libata: Move sector_buf from struct ata_port to struct ata_device 2024-09-07 10:16:55 +09:00
libata.h ata: libata: Improve CDL resource management 2024-09-07 10:16:56 +09:00
Makefile ATA changes for 6.3-rc1 2023-02-22 13:35:51 -08:00
pata_acpi.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_ali.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_amd.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_arasan_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_artop.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_atiixp.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_atp867x.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_buddha.c ata: pata_buddha: Remove #include <asm/ide.h> 2023-08-24 08:09:59 +09:00
pata_cmd64x.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_cmd640.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_cs5520.c ata: pata_cs5520: Rephrase file header comment 2024-07-30 07:10:30 +09:00
pata_cs5530.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_cs5535.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_cs5536.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_cypress.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_efar.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_ep93xx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_falcon.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_ftide010.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_gayle.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_hpt3x2n.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_hpt3x3.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_hpt37x.c ata: pata_hpt37x: Rename hpt_dma_blacklisted() 2024-07-30 07:10:38 +09:00
pata_hpt366.c ata: pata_hpt366: Rename hpt_dma_blacklisted() 2024-07-30 07:10:34 +09:00
pata_icside.c ata: libata: Remove ata_noop_qc_prep() 2024-08-02 09:18:42 +09:00
pata_imx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_isapnp.c ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-11-20 09:22:26 +09:00
pata_it821x.c ata: libata: Use QUIRK instead of HORKAGE 2024-07-30 07:09:54 +09:00
pata_it8213.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_ixp4xx_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_jmicron.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_legacy.c ata: pata_legacy: make legacy_exit() work again 2024-05-07 07:23:31 +09:00
pata_macio.c ata: pata_macio: Use WARN instead of BUG 2024-08-21 14:33:23 +09:00
pata_marvell.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_mpc52xx.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_mpiix.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_netcell.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_ninja32.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_ns87410.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_ns87415.c ata: pata_ns87415: mark ns87560_tf_read static 2023-07-28 08:52:42 +09:00
pata_octeon_cf.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_of_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_oldpiix.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_opti.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_optidma.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_pcmcia.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_pdc202xx_old.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_pdc2027x.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_piccolo.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_platform.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_pxa.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_radisys.c ata: Fix typos in the comment 2024-10-01 09:22:02 +02:00
pata_rb532_cf.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
pata_rdc.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_rz1000.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_sc1200.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_sch.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_serverworks.c ata: pata_serverworks: Do not use the term blacklist 2024-07-30 07:10:08 +09:00
pata_sil680.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_sis.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_sl82c105.c ata: libata: remove deprecated EH callbacks 2023-08-02 17:45:42 +09:00
pata_triflex.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pata_via.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
pdc_adma.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_dwc_460ex.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_fsl.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_gemini.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_gemini.h
sata_highbank.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_inic162x.c ata: fix debounce timings type 2023-08-02 17:37:06 +09:00
sata_mv.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_nv.c scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
sata_promise.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_promise.h
sata_qstor.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_rcar.c ata: Switch back to struct platform_driver::remove() 2024-10-17 09:55:08 +02:00
sata_sil24.c scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
sata_sil.c ata: sata_sil: Rename sil_blacklist to sil_quirks 2024-07-30 07:10:21 +09:00
sata_sis.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_svw.c ata: Use of_property_read_reg() to parse "reg" 2023-06-13 15:38:48 +09:00
sata_sx4.c ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit 2024-04-01 07:52:17 +09:00
sata_uli.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_via.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sata_vsc.c scsi: ata: Declare SCSI host templates const 2023-03-24 19:19:19 -04:00
sis.h