linux-next/drivers
Damien Le Moal b76b840fd9 dm: Fix dm-zoned-reclaim zone write pointer alignment
The zone reclaim processing of the dm-zoned device mapper uses
blkdev_issue_zeroout() to align the write pointer of a zone being used
for reclaiming another zone, to write the valid data blocks from the
zone being reclaimed at the same position relative to the zone start in
the reclaim target zone.

The first call to blkdev_issue_zeroout() will try to use hardware
offload using a REQ_OP_WRITE_ZEROES operation if the device reports a
non-zero max_write_zeroes_sectors queue limit. If this operation fails
because of the lack of hardware support, blkdev_issue_zeroout() falls
back to using a regular write operation with the zero-page as buffer.
Currently, such REQ_OP_WRITE_ZEROES failure is automatically handled by
the block layer zone write plugging code which will execute a report
zones operation to ensure that the write pointer of the target zone of
the failed operation has not changed and to "rewind" the zone write
pointer offset of the target zone as it was advanced when the write zero
operation was submitted. So the REQ_OP_WRITE_ZEROES failure does not
cause any issue and blkdev_issue_zeroout() works as expected.

However, since the automatic recovery of zone write pointers by the zone
write plugging code can potentially cause deadlocks with queue freeze
operations, a different recovery must be implemented in preparation for
the removal of zone write plugging report zones based recovery.

Do this by introducing the new function blk_zone_issue_zeroout(). This
function first calls blkdev_issue_zeroout() with the flag
BLKDEV_ZERO_NOFALLBACK to intercept failures on the first execution
which attempt to use the device hardware offload with the
REQ_OP_WRITE_ZEROES operation. If this attempt fails, a report zone
operation is issued to restore the zone write pointer offset of the
target zone to the correct position and blkdev_issue_zeroout() is called
again without the BLKDEV_ZERO_NOFALLBACK flag. The report zones
operation performing this recovery is implemented using the helper
function disk_zone_sync_wp_offset() which calls the gendisk report_zones
file operation with the callback disk_report_zones_cb(). This callback
updates the target write pointer offset of the target zone using the new
function disk_zone_wplug_sync_wp_offset().

dmz_reclaim_align_wp() is modified to change its call to
blkdev_issue_zeroout() to a call to blk_zone_issue_zeroout() without any
other change needed as the two functions are functionnally equivalent.

Fixes: dd291d77cc ("block: Introduce zone write plugging")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20241209122357.47838-4-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-12-10 09:15:33 -07:00
..
accel module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
accessibility speakup: use SPKDIR=$(src) to specify the source directory 2024-11-04 17:53:09 +09:00
acpi module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
amba ARM: 9415/1: amba: Add dev_is_amba() function and export it for modules 2024-11-12 16:41:45 +00:00
android Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1 2024-11-29 11:58:27 -08:00
ata pci-v6.13-changes 2024-11-26 18:05:44 -08:00
atm Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
auxdisplay module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
base module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
bcma Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
block virtio-blk: don't keep queue frozen during system suspend 2024-12-05 10:00:20 -07:00
bluetooth Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bus Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1 2024-11-29 11:58:27 -08:00
cache
cdrom Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
cdx module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
char Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
clk module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
clocksource Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
comedi comedi: Flush partial mappings in error case 2024-11-05 14:01:07 +01:00
connector
counter module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
cpufreq powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
cpuidle Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
crypto module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
cxl module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dax module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dca
devfreq Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
dio
dma module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dma-buf module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dpll dpll: add clock quality level attribute and op 2024-11-03 08:39:07 -08:00
edac Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
eisa
extcon Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
firewire firewire updates for v6.13 2024-11-25 17:12:54 -08:00
firmware module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
fpga module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
fsi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
gnss
gpio module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
gpu module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
greybus greybus: Fix a typo 2024-11-05 05:33:46 +01:00
hid module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
hsi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hte Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hv Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hwmon module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
hwspinlock Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hwtracing Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
i2c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i3c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
idle intel_idle: add Granite Rapids Xeon D support 2024-11-11 15:48:50 +01:00
iio module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
infiniband module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
input Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
interconnect Merge branch 'icc-sar2130p' into icc-next 2024-11-05 01:32:05 +02:00
iommu module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ipack
irqchip - Move the ->select callback to the correct ops structure in irq-mvebu-sei to 2024-12-01 12:37:58 -08:00
isdn mISDN: Fix typos 2024-11-09 09:14:12 -08:00
leds module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
macintosh Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
mailbox TTY / Serial driver updates for 6.13-rc1 2024-11-30 09:03:16 -08:00
mcb module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
md dm: Fix dm-zoned-reclaim zone write pointer alignment 2024-12-10 09:15:33 -07:00
media module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
memory Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
memstick Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
message scsi: fusion: Remove unused variable 'rc' 2024-11-06 20:46:07 -05:00
mfd module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
misc module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mmc MMC core: 2024-11-20 12:51:32 -08:00
most
mtd This pull request contains updates for JFFS2, UBI and UBIFS: 2024-11-30 10:32:47 -08:00
mux
net module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
nfc
ntb
nubus
nvdimm module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
nvme nvme fixes for Linux 6.13 2024-12-05 10:14:36 -07:00
nvmem Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
of Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
opp Additional power management updates for 6.13-rc1 2024-11-27 14:40:33 -08:00
parisc Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
parport Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pci module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pcmcia Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
peci module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
perf module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
phy Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
pinctrl module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
platform module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pmdomain Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pnp
power power supply and reset changes for the 6.13 series 2024-11-28 09:28:09 -08:00
powercap module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pps Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
ps3 ps3: Correct some typos in comments 2024-11-15 00:32:29 +11:00
ptp Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pwm module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
rapidio
ras
regulator regulator: Fixes for v6.13 2024-11-28 09:40:53 -08:00
remoteproc remoteproc: qcom: wcss: Remove double assignment in q6v5_wcss_probe() 2024-11-15 20:36:27 -08:00
reset module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
rpmsg Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
rtc module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
s390 Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
sbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
scsi Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
sh sh updates for v6.13 2024-11-30 14:45:29 -08:00
siox
slimbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
soc Networking changes for 6.13. 2024-11-21 08:28:08 -08:00
soundwire module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
spi module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
spmi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
ssb
staging module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
target SCSI misc on 20241125 2024-11-25 18:50:55 -08:00
tc TC: Fix the wrong format specifier 2024-11-12 15:48:08 +01:00
tee Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
thermal module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
thunderbolt USB / Thunderbolt (USB4) changes for 6.13-rc1 2024-11-29 11:19:31 -08:00
tty module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ufs Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
uio Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
usb module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
vdpa vdpa/mlx5: Fix suboptimal range on iotlb iteration 2024-11-12 18:05:05 -05:00
vfio module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
vhost mm: page_frag: avoid caller accessing 'page_frag_cache' directly 2024-11-11 10:56:27 -08:00
video module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
virt Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
virtio module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
w1 Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
watchdog module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xen module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
zorro
Kconfig
Makefile