[PATCH v2 0/2] enable sector size > PAGE_SIZE for scsi

sw.prabhu6@gmail.com posted 2 patches 13 hours ago
drivers/scsi/scsi_debug.c |  8 +---
drivers/scsi/sd.c         | 79 +++++++++++++++++++++++++++++++++------
2 files changed, 68 insertions(+), 19 deletions(-)
[PATCH v2 0/2] enable sector size > PAGE_SIZE for scsi
Posted by sw.prabhu6@gmail.com 13 hours ago
From: Swarna Prabhu <sw.prabhu6@gmail.com>

Hi All,

This is v2 series sent based on the feedback received on v1 [1] and RFC
series. This patchset enables sector sizes > PAGE_SIZE for
sd driver and scsi_debug driver since block layer can support block
size > PAGE_SIZE. There was one issue with write_same16 and write_same10
command, which is fixed as a part of the series.

Changes since v1:
 - Retain the single page mempool for the regular devices.
 - Initialize a large page mempool at 'sd_probe' when the first device with
   sector size > 4k is detected for sd driver with ensuring atomicity.
 - Safe destruction of the large page mempool in 'sd_probe' if the device
   fails at probe after the mempool is successfully created.
 - Safe destruction of the large page mempool in 'sd_remove' when the last
   device with sector size > PAGE_SIZE is detached from the system.
 - Added a check in 'sd_set_special_bvec' to use the correct mempool for
   allocation based on the sector size of the device.
 - Added a check in 'sd_uninit_command' to use the correct mempool for
   freeing based on the sector size of the device.
 - Added check to destroy large page mempool if it exists while exiting
   sd driver.
 - Slightly modified the git commit message to update the above changes
   for scsi sd driver fix patch.

Thanks to Damien for feedback on the v1 series.

Testing:
 -Test suite: xfs and generic from fstest + QEMU emulated block
    device(scsi and nvme)
  - fstest Config for patched xfs 16k block size [xfs_reflink_16k_scsi]
    TEST_DEV=/dev/sda
    SCRATCH_DEV_POOL="/dev/sdb"
    MKFS_OPTIONS='-f -m reflink=1,rmapbt=1, -i sparse=1, -b size=16384,
    -s size=16384'
  - Generic test results
    Baseline: 6.19-rc8 kernel + nvme 16k logical block size
    Patched: 6.19-rc8 kernel + scsi 16k logical block size
    No regressions introduced by the patch.
  - XFS tests results
    Baseline: 6.19-rc8 kernel + nvme 16k logical block size
    Patched: 6.19-rc8 kernel + scsi 16k logical block size
    No regressions introduced by the patch
  - Blktests results
    scsi and block layer tests with 16k logical block size.
    Baseline: vanilla kernel + scsi 4k
    No regressions seen by the patch.

Link to v1: https://lore.kernel.org/all/20251210014136.2549405-1-sw.prabhu6@gmail.com/ [1]

Swarna Prabhu (2):
  scsi: sd: fix write_same(16/10) to enable sector size > PAGE_SIZE
  scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE

 drivers/scsi/scsi_debug.c |  8 +---
 drivers/scsi/sd.c         | 79 +++++++++++++++++++++++++++++++++------
 2 files changed, 68 insertions(+), 19 deletions(-)

-- 
2.39.5