[PATCH] skd: disable discard support

From: Mike Snitzer
Date: Wed Feb 12 2014 - 17:18:48 EST


The skd driver has never handled discards reliably.

The kernel will BUG as a result of issuing discards to the skd device.
Disable the skd driver's discard support until it is proven reliable.

The device-mapper-test-suite test that exposed this bug just issues a
discard that covers a portion of the skd device that was previously
written through a dm-thin device. The discard spans the entire 1GB thin
device (logical sector 0 through 2097152).

dmtest run --profile stec --suite thin-provisioning -n /discard_fully_provisioned_device/

associated device-mapper-test-suite ruby test code follows:

def test_discard_fully_provisioned_device
with_standard_pool(@size) do |pool|
with_new_thins(pool, @volume_size, 0, 1) do |thin, thin2|
wipe_device(thin)
wipe_device(thin2)
assert_used_blocks(pool, 2 * @blocks_per_dev)
thin.discard(0, @volume_size)
assert_used_blocks(pool, @blocks_per_dev)
end
end
...

Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
---
drivers/block/skd_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index eb6e1e0..5dadecc 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -4441,12 +4441,15 @@ static int skd_cons_disk(struct skd_device *skdev)
/* set sysfs ptimal_io_size to 8K */
blk_queue_io_opt(q, 8192);

+#if 0
+ /* FIXME: Disable discard support until it no longer BUGs */
/* DISCARD Flag initialization. */
q->limits.discard_granularity = 8192;
q->limits.discard_alignment = 0;
q->limits.max_discard_sectors = UINT_MAX >> 9;
q->limits.discard_zeroes_data = 1;
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
+#endif
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);

spin_lock_irqsave(&skdev->lock, flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/