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
commita7ce0d703547ab264a3786285f3484fc2962287b (patch)
tree52c2ce82f91bf67243862cf9d500dbdd8b8da239 /drivers/md
parent11f41b00be2b18c787a8dc5a167024a2c472e76f (diff)
dm-zero-silently-drop-discards
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-zero.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
index bbc97030c0c2..cc2b3cb81946 100644
--- a/drivers/md/dm-zero.c
+++ b/drivers/md/dm-zero.c
@@ -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;
}