Skip to content

Commit

Permalink
dm: error return error for discards
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Aug 12, 2010
1 parent 3fd5d48 commit 38e1b25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/dm-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 38e1b25

Please sign in to comment.