From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 6 Aug 2015 13:06:38 +0200 (CEST) Received: by wibhh20 with SMTP id hh20so19026474wib.0 for ; Thu, 06 Aug 2015 04:06:37 -0700 (PDT) References: <55C3060B.6030206@freescale.com> <55C325AE.6070604@gmail.com> <55C33919.40101@freescale.com> From: Milan Broz Message-ID: <55C33FBC.9010604@gmail.com> Date: Thu, 6 Aug 2015 13:06:36 +0200 MIME-Version: 1.0 In-Reply-To: <55C33919.40101@freescale.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] out of order encryption List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vasile Catalin-B50542 , dm-crypt@saout.de On 08/06/2015 12:38 PM, Vasile Catalin-B50542 wrote: > I was referring to the submitted requests. > Does the underlying encryption layer (CryptoAPI) have to ensure the > complete callbacks are called in the order the requests were submitted? No. And it really does not matter, requests are independent. > Or does dm-crypt figure out where to read/write after request is done > no matter in which order the crypto requests finished? In recent kernels write request are in dmcrypt partially sorted for performance reasons http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/md/dm-crypt.c?id=b3c5fd3052492f1b8d060799d4f18be5a5438add Otherwise there is no other logic related. m. > > On 06.08.2015 12:15, Milan Broz wrote: >> On 08/06/2015 09:00 AM, Vasile Catalin-B50542 wrote: >>> Would dm-crypt execute correctly if sector encryption ended asynchronously? >>> For example: >>> If sector 1, 2, 3 are sent to be done asynchronously to the same >>> algorithm instance, >>> and the jobs end in the following order: 2, 1, 3; does the dm-crypt >>> module know to >>> write the data in the proper place when the encryption "done" callback >>> is called? >> Not sure if I understand your question - encryption in dmcrypt works on sector >> level, sectors are encrypted independetly, so order cannot influence result >> of encryption of individual sectors. >> >> Or if the question is about order of submitted requests: >> If you need to ensure order of processing, you have to issue "flush" operation >> before submitting next data content. Filesystems typically must do this when >> handling journal or so. >> >> In general, requests order can be rearranged (anywhere in block layer, not only in dmcrypt). >> But this is correct behaviour. >> >> Milan > > _______________________________________________ > dm-crypt mailing list > dm-crypt@saout.de > http://www.saout.de/mailman/listinfo/dm-crypt >