summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-target.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2010-08-12 04:14:14 +0100
committerAlasdair G Kergon <agk@redhat.com>2010-08-12 04:14:14 +0100
commit38e1b257fd7b4f3eee667d29a5e44ec15e253c1c (patch)
treec5b8d853de330cb2db9fefc8588e283a1916b934 /drivers/md/dm-target.c
parent3fd5d48027181168ce85e8094b926aeb9f34c556 (diff)
downloadlinux-38e1b257fd7b4f3eee667d29a5e44ec15e253c1c.tar.bz2
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>
Diffstat (limited to 'drivers/md/dm-target.c')
-rw-r--r--drivers/md/dm-target.c5
1 files changed, 5 insertions, 0 deletions
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;
}