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 <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by Mike Snitzer and committed by Alasdair G Kergon 38e1b257 3fd5d480

+5
+5
drivers/md/dm-target.c
··· 113 113 */ 114 114 static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args) 115 115 { 116 + /* 117 + * Return error for discards instead of -EOPNOTSUPP 118 + */ 119 + tt->num_discard_requests = 1; 120 + 116 121 return 0; 117 122 } 118 123