dm error: add discard support
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 4 Apr 2023 15:22:10 +0000 (11:22 -0400)
committerMike Snitzer <snitzer@kernel.org>
Tue, 4 Apr 2023 17:30:17 +0000 (13:30 -0400)
commitb6bcb84446810df0c9364ee6e23e07866316beaf
tree8f0efcea0b73cfc3686d9ed06463ca3c71c3d3d0
parent00065f925efb077ade3e7fea49150d798cf87d05
dm error: add discard support

Add io_err_io_hints() and set discard limits so that the zero target
advertises support for discards.

The error target will return -EIO for discards.

This is useful when the user combines dm-error with other
discard-supporting targets in the same table; without dm-error
support, discards would be disabled for the whole combined device.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-target.c