Patchwork [2/2] dm-crypt: never use write same

login
register
mail settings
Submitter Joseph Salisbury
Date Dec. 19, 2012, 10:52 p.m.
Message ID <d57744d941ecb8e6bf9c3be96e07f7319145eb28.1355952335.git.joseph.salisbury@canonical.com>
Download mbox | patch
Permalink /patch/207537/
State New
Headers show

Comments

Joseph Salisbury - Dec. 19, 2012, 10:52 p.m.
From: Joseph Salisbury <joseph.salisbury@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1089818

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/md/dm-crypt.c |    7 +++++++
 1 file changed, 7 insertions(+)

Patch

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index bbf459b..60f5461 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1844,6 +1844,12 @@  static int crypt_iterate_devices(struct dm_target *ti,
 	return fn(ti, cc->dev, cc->start, ti->len, data);
 }
 
+static void crypt_io_hints(struct dm_target *ti,
+			    struct queue_limits *limits)
+{
+	limits->max_write_same_sectors = 0;
+}
+
 static struct target_type crypt_target = {
 	.name   = "crypt",
 	.version = {1, 11, 0},
@@ -1858,6 +1864,7 @@  static struct target_type crypt_target = {
 	.message = crypt_message,
 	.merge  = crypt_merge,
 	.iterate_devices = crypt_iterate_devices,
+	.io_hints = crypt_io_hints,
 };
 
 static int __init dm_crypt_init(void)