Skip to content

Commit

Permalink
dm: zero silently drop discards
Browse files Browse the repository at this point in the history
Have the zero target silently drop a discard 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 b441a26 commit f8facb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/dm-zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
return -EINVAL;
}

/*
* Silently drop discards, avoiding -EOPNOTSUPP.
*/
ti->num_discard_requests = 1;

return 0;
}

Expand Down

0 comments on commit f8facb6

Please sign in to comment.