]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: sd: Enable sector size > PAGE_SIZE in SCSI sd driver
authorSwarna Prabhu <sw.prabhu6@gmail.com>
Thu, 19 Feb 2026 04:37:42 +0000 (20:37 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Mar 2026 01:49:00 +0000 (20:49 -0500)
commit7179e626b76eb42f2529c6f6dd6ba88ea2445372
tree666c2ff18e62885cf0f7e665ec43a1cc7bf1101f
parent50209dec14f8c594a9ef26237b7e7ddd39e12a40
scsi: sd: Enable sector size > PAGE_SIZE in SCSI sd driver

The WRITE SAME(16) and WRITE SAME(10) SCSI commands use a page from a
dedicated mempool (sd_page_pool) for their payload. This pool was
initialized to allocate single pages, which was sufficient as long as the
device sector size did not exceed the PAGE_SIZE.

Given that block layer now supports block size upto 64KB, i.e. beyond
PAGE_SIZE, initialize a large page pool in sd_probe() if a higher sector
device is attached, ensuring atomicity. Adapt sd_set_special_bvec() to use
large page pool when a higher sector size device is attached. Hence enable
sector sizes > PAGE_SIZE in SCSI sd driver.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Swarna Prabhu <s.prabhu@samsung.com>
Co-developed-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Link: https://patch.msgid.link/20260219043741.276729-2-sw.prabhu6@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c