lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Feb 2014 17:18:36 -0500
From:	Mike Snitzer <snitzer@...hat.com>
To:	Akhil Bhansali <abhansali@...c-inc.com>
Cc:	Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: [PATCH] skd: disable discard support

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@...hat.com>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ