From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754067AbcAMCSP (ORCPT ); Tue, 12 Jan 2016 21:18:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58966 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753929AbcAMCSN (ORCPT ); Tue, 12 Jan 2016 21:18:13 -0500 Date: Tue, 12 Jan 2016 21:18:12 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Arnd Bergmann cc: device-mapper development , Mark Brown , Milan Broz , Jens Axboe , keith.busch@intel.com, linux-raid@vger.kernel.org, martin.petersen@oracle.com, Mike Snitzer , Baolin Wang , linux-block@vger.kernel.org, neilb@suse.com, LKML , sagig@mellanox.com, tj@kernel.org, dan.j.williams@intel.com, Kent Overstreet , Alasdair G Kergon Subject: Re: [dm-devel] [PATCH v2 0/2] Introduce the bulk IV mode for improving the crypto engine efficiency In-Reply-To: <5514385.nEhTK7fEcU@wuerfel> Message-ID: References: <20160104201343.GQ16023@sirena.org.uk> <5514385.nEhTK7fEcU@wuerfel> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jan 2016, Arnd Bergmann wrote: > On Tuesday 12 January 2016 18:31:19 Mikulas Patocka wrote: > > > > Another possibility is to use dm-crypt block size 4k and use a filesystem > > with 4k blocksize on it (it will never send requests not aligned on 4k > > boundary, so we could reject such requests with an error). > > Is there ever a reason to use something other than 4K block size on > dm-crypt? > > Arnd You can't use 4k block on CBC (and most other encryption modes). If only a part of 4k block is written (and then system crash happens), CBC would corrupt the block completely. For example, suppose that EXT2 directory block is updated, the first 512-byte sector is written and the rest of the sectors is not written because of a crash. CBC would corrupt all sectors except the first one in this case. You could use 4k block on XTS and ECB. Mikulas