Commit 38e1b257fd7b4f3eee667d29a5e44ec15e253c1c

Authored by Mike Snitzer
Committed by Alasdair G Kergon
1 parent 3fd5d48027

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/md/dm-target.c
... ... @@ -113,6 +113,11 @@
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