From patchwork Wed Dec 19 21:07:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 207803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 6BA0F2C0097 for ; Fri, 21 Dec 2012 23:57:54 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tm2AS-0000Ga-07; Fri, 21 Dec 2012 12:57:36 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TlQrF-0002V8-Fj for kernel-team@lists.ubuntu.com; Wed, 19 Dec 2012 21:07:17 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBJL7EMt025903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Dec 2012 16:07:14 -0500 Received: from [192.168.2.18] (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBJL7CoC018267; Wed, 19 Dec 2012 16:07:12 -0500 Message-ID: <50D22C7F.2020201@redhat.com> Date: Wed, 19 Dec 2012 22:07:11 +0100 From: Milan Broz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110807 Thunderbird/5.0 MIME-Version: 1.0 To: Mike Snitzer Subject: [PATCH] dm-crypt: never use write same (was Re: [v3.7 Regression] [SCSI] sd: Implement support for WRITE SAME) References: <50CB8C74.3090102@canonical.com> <50D0C971.1000907@canonical.com> <20121219195801.GA14456@redhat.com> <50D22766.9090107@redhat.com> In-Reply-To: <50D22766.9090107@redhat.com> X-Enigmail-Version: 1.4.6 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Mailman-Approved-At: Fri, 21 Dec 2012 12:57:30 +0000 Cc: "Martin K. Petersen" , linux-kernel@vger.kernel.org, JBottomley@Parallels.com, Kernel Team , jgarzik@redhat.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Does this help? dm-crypt: never use write same Ciphertext device is not compatible with WRITE SAME, disable it for all dmcrypt devices. Signed-off-by: Milan Broz Acked-by: Martin K. Petersen --- 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)