]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm: Allow .prepare_ioctl to handle ioctls directly
authorKevin Wolf <kwolf@redhat.com>
Tue, 29 Apr 2025 16:50:17 +0000 (18:50 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Sun, 4 May 2025 09:35:05 +0000 (11:35 +0200)
commit4862c8861d902d43645a493e441c4478be1c6c44
tree9f47c4c4e622c33406e9151943e12ddd20d1369a
parent13e79076c89f6e96a6cca8f6df38b40d025907b4
dm: Allow .prepare_ioctl to handle ioctls directly

This adds a 'bool *forward' parameter to .prepare_ioctl, which allows
device mapper targets to accept ioctls to themselves instead of the
underlying device. If the target already fully handled the ioctl, it
sets *forward to false and device mapper won't forward it to the
underlying device any more.

In order for targets to actually know what the ioctl is about and how to
handle it, pass also cmd and arg.

As long as targets restrict themselves to interpreting ioctls of type
DM_IOCTL, this is a backwards compatible change because previously, any
such ioctl would have been passed down through all device mapper layers
until it reached a device that can't understand the ioctl and would
return an error.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-dust.c
drivers/md/dm-ebs-target.c
drivers/md/dm-flakey.c
drivers/md/dm-linear.c
drivers/md/dm-log-writes.c
drivers/md/dm-mpath.c
drivers/md/dm-switch.c
drivers/md/dm-verity-target.c
drivers/md/dm-zoned-target.c
drivers/md/dm.c
include/linux/device-mapper.h