dm thin: do not expose non-zero discard limits if discards disabled
authorMike Snitzer <snitzer@redhat.com>
Thu, 19 Sep 2013 22:49:11 +0000 (18:49 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 23 Sep 2013 14:42:06 +0000 (10:42 -0400)
commitb60ab990ccdf34b0159bf5ff52f4acee7c940d78
tree9a05149474e38190b0ed676ec98853ce5099da44
parentf84cb8a46a771f36a04a02c61ea635c968ed5f6a
dm thin: do not expose non-zero discard limits if discards disabled

Fix issue where the block layer would stack the discard limits of the
pool's data device even if the "ignore_discard" pool feature was
specified.

The pool and thin device(s) still had discards disabled because the
QUEUE_FLAG_DISCARD request_queue flag wasn't set.  But to avoid user
confusion when "ignore_discard" is used: both the pool device and the
thin device(s) have zeroes for all discard limits.

Also, always set discard_zeroes_data_unsupported in targets because they
should never advertise the 'discard_zeroes_data' capability (even if the
pool's data device supports it).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
drivers/md/dm-thin.c