Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1075575pxb; Thu, 15 Apr 2021 13:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhsbpiCCoGt7ZBMmBkLau/E04anArvsTSrMDKTX+sQebrPaxORTZW4k+g1zDNld6l70MPf X-Received: by 2002:aa7:dd98:: with SMTP id g24mr6361419edv.75.1618518282483; Thu, 15 Apr 2021 13:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618518282; cv=none; d=google.com; s=arc-20160816; b=ytIHAzfiAu5Ic6Ie1JJcSuzr7dRpvAA1NLVJaesK10Dm9EgY1vospfsSdODV03LVc4 hzsN+7GOiSXzsxewoUYqCLoJQCk2TnYXND0PypW8di+t6xho7cyptIPkdJS6gjjPl8h0 ZV17cqmGRFNGvxQG7LHtIcHAYWNN8Ey/fgcoQR9dTlZodjggCo+K++9apMGdBQXTYCRg gy9j62FvnZoA1QjsAgcNa854Cyt3XL0cNvgHIT9BzPvx8OByELhAEd76wpJtddVUFP9C 8lNHBt5Csl+SKps/f48THkCgkIGZTgtvd4wwVK+OA3/+KcTe+lYLfdpKr7Y9r/umbUCv c8Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=crF1eASnpH0y/1LDTIAzQwlh79h4dNNMBJfuSKhXIb4=; b=qYvBav7xK+3e/z3P8mpbRxU8FxAOPOauKpxJM9isD6VWcOwPXfkeNV7Cn3vatIqFm2 N+Y0VY72gOE8q/4u3WnoWGxPe6shd/bcoGqI18EC934dUoShuvcxLyWP4xZM+mAHXJ98 nokHD2vcvclhCIQPoxNGAyZxTA5WazH9CjQ4pEfEoD2ilpIWshmvggEjk7HqdchEWMod IOw8JL4fYjz+VDIiO0QxZpbDxiKcttB8+r4SDrqmNU9iMsL06o49WVU2CfgWFNqXHZKH K/Zoo/xz63J3sCwt4o1R6kORd5MQXasGHZR7qamu9LHMj4N8N0ZH1Sntcks53CZDnw2s nsdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rlttjChm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si3067763ejb.384.2021.04.15.13.24.18; Thu, 15 Apr 2021 13:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rlttjChm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234779AbhDOTd2 (ORCPT + 99 others); Thu, 15 Apr 2021 15:33:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:55072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234506AbhDOTd2 (ORCPT ); Thu, 15 Apr 2021 15:33:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 58ABC610EA; Thu, 15 Apr 2021 19:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618515184; bh=pmEpC+vDwdqGGg9r8ZJX9nLfrlZ2KwOgLUu2CwzCg8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rlttjChmO1Bls6od5POk8j49Yd6/WKgmF/RQxekWWT2G4YDlg4ksIfBiub3Au4AD6 +dMbd7oExE5xJduGozCjLZK859Z3iqbXH38sXYIM1LcID48PzM7v1MEgcxszgfZ7+5 di1N4OYMuHNX38+e1rVZWen6cu+5St3CbTfXgYJekbEHfvOU4CcBCY0tEtPYFadDbJ AVF4qtidffwzk8jSAZ/pvLWJ3R5ZSiXSMKF86bpT9eXR8+O7KjhXMQJXe7FB3rV7yR qGQE8Fn1Ye1MPoshT9LulWVI+YAunbJv6Dbm3TpsJN0Dm1ZB5IJMle6TDv/mVOCWAf FU7TJLezFJ7+g== Date: Thu, 15 Apr 2021 12:33:02 -0700 From: Eric Biggers To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe Subject: Re: [PATCH v2 3/8] block: blk-crypto: introduce blk_crypto_bio_sectors_alignment() Message-ID: References: <20210325212609.492188-1-satyat@google.com> <20210325212609.492188-4-satyat@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210325212609.492188-4-satyat@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 09:26:04PM +0000, Satya Tangirala wrote: > The size of any bio must be aligned to the data unit size of the bio crypt > context (if it exists) of that bio. This must also be ensured whenever a > bio is split. Introduce blk_crypto_bio_sectors_alignment() that returns > the required alignment in sectors. The number of sectors passed to > any call of bio_split() should be aligned to > blk_crypto_bio_sectors_alignment(). "should be aligned" => "must be aligned"? > +/* > + * Returns the alignment requirement for the number of sectors in this bio based > + * on its bi_crypt_context. Any bios split from this bio must follow this > + * alignment requirement as well. > + */ It would be helpful to expand this comment a bit to explictly mention that the size of the bio must be a multiple of the crypto data unit size that was selected by the submitter of the bio, which is the granularity of encryption/decryption. Keep in mind that people reading this code won't necessarily be familiar with inline encryption. - Eric