From: Mike Snitzer Date: Thu, 12 Aug 2010 03:14:14 +0000 (+0100) Subject: dm: error return error for discards X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~24804^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=38e1b257fd7b4f3eee667d29a5e44ec15e253c1c;p=mirror_ubuntu-focal-kernel.git dm: error return error for discards Have the error target respond to a discard request with a hard -EIO rather than fail the request with -EOPNOTSUPP. Signed-off-by: Mike Snitzer Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c index 11dea11dc0b6..8da366cf381c 100644 --- a/drivers/md/dm-target.c +++ b/drivers/md/dm-target.c @@ -113,6 +113,11 @@ void dm_unregister_target(struct target_type *tt) */ static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args) { + /* + * Return error for discards instead of -EOPNOTSUPP + */ + tt->num_discard_requests = 1; + return 0; }