summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2010-08-03 11:30:41 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2010-08-03 11:30:41 +1000
commitabccd1ab675331a4854de2290e28510e9d33a5b4 (patch)
tree5bd2bfa05f4618f3a5caa17123bd3e0622910a7b /drivers/md
parent8d8389c8dfc409ea8f2eb57962f0bd44603dd7dc (diff)
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')
-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;
}