Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1593288pxb; Wed, 10 Feb 2021 11:59:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJytnwAUjOoJc4rPB3hSOsSqNPWQbYWqAtxYgPCH7+rZIVEsS5sB9SC1yOHEF3z/NF9JuejR X-Received: by 2002:aa7:ce13:: with SMTP id d19mr4905042edv.208.1612987163726; Wed, 10 Feb 2021 11:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612987163; cv=none; d=google.com; s=arc-20160816; b=ctUJsRcrhkW/+OhE3ja24Lei7XOItJmrVXEXCdVND/UAQKqJmrQgLDAryTzvKPAP+9 FBvUg4Ur8ao4DothjkLese4BXYSxxhOV+JkXCb/tk4bnXU0BzAeVXtPiGEg9W6wd0NhV IR15hS1xa0+8otr8ya0hWCG6bI+5D8x6722zW1CoamDGZ80ABb8FOVYjf6/pdeZdrH2I yY9lUP440VYZn1soVf419VOK7e0WU0eVBvgUpVKWestOByMJSr1EXr8VafbCmqh26LBr Mx5uQUz7oJdjhj2lBbR7u/BuqRVgh/4x2j2s/55HTDhA2FT3Wex+USHSgmmTA5VDPjY6 qmyQ== 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=ysZ/j1zjzPz6Kx4uRUiB5dFP9QzY9BqyoKKkMv5Gn9g=; b=HdCJiWtZ1tUdW3uMDcaFF3G5ko8GBTaxD9yufRBJJQVXeDB525ycEEXyBKGLW2NKT0 Uo2bhkszx17X7kGWbe+V04xNRjwbOv6D8JuCRZ6ZCoJLopzG9CFsXwIdvlHkuHhs8Ezc orNFQJfyoBFUibhIdcJiU0pQw0gpdRv6IzhAGRZjbSnkDm57UqPV7HrEfHDc/ndZxgL+ jZXtbzQ7LkHJfljIRNcJg7Ya8HOTvI2a5Uh7DRIEJlEorLruEbfQmmruaYW8ViEfeuNt c3QibubGquYOX4TM6YKMSlyblpnsj1FpQQ7RP7gsjFJbL6b2bLElkvAHeVlvjBHHBOXR 1dgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FKdzL3VU; 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 17si1982690ejv.562.2021.02.10.11.58.59; Wed, 10 Feb 2021 11:59:23 -0800 (PST) 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=FKdzL3VU; 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 S232308AbhBJT4V (ORCPT + 99 others); Wed, 10 Feb 2021 14:56:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:40978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbhBJT4T (ORCPT ); Wed, 10 Feb 2021 14:56:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6720364EE6; Wed, 10 Feb 2021 19:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612986938; bh=ElHjRVDpTBGUt44dTaqqIQgE/uiYoro9zAeSbmvpjO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FKdzL3VUubLm16LA7nGgWiHA7wUTtWeudA77EbB1KZK6YT8yftZlvYeee8I16GWUU QMu8VSPPW5hdNddTx/Xl/4t+f/PhvloatKpTHKihs/a6m1WFt3xz8tHl5M6011i0Z6 PynruIaekTHNVekiG1ZOoivuL1zSnvwPae4GIXbhmq1ra+gHrmWUK6ZEL4vn8tMFUm /Ri8lH6PogA/pOhX5AdRrUQoMxeS6DU+rlSPPIahMPlQ+zTDmr4iestS1PRAFRl1YC 47wuzJXImXWVdWXz2znyYWb1seWpTpAkcyfAzNcGc3JFhNZ73pjiOT0hcz8isxcGZM kbSH5TvKDgDiA== Date: Wed, 10 Feb 2021 11:55:36 -0800 From: Eric Biggers To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, Jens Axboe , Mike Snitzer , Alasdair Kergon Subject: Re: [PATCH v4 2/5] block: keyslot-manager: Introduce functions for device mapper support Message-ID: References: <20210201051019.1174983-1-satyat@google.com> <20210201051019.1174983-3-satyat@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210201051019.1174983-3-satyat@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 05:10:16AM +0000, Satya Tangirala wrote: > Introduce blk_ksm_update_capabilities() to update the capabilities of > a keyslot manager (ksm) in-place. The pointer to a ksm in a device's > request queue may not be easily replaced, because upper layers like > the filesystem might access it (e.g. for programming keys/checking > capabilities) at the same time the device wants to replace that > request queue's ksm (and free the old ksm's memory). This function > allows the device to update the capabilities of the ksm in its request > queue directly. Devices can safely update the ksm this way without any > synchronization with upper layers *only* if the updated (new) ksm > continues to support all the crypto capabilities that the old ksm did > (see description below for blk_ksm_is_superset() for why this is so). > > Also introduce blk_ksm_is_superset() which checks whether one ksm's > capabilities are a (not necessarily strict) superset of another ksm's. > The blk-crypto framework requires that crypto capabilities that were > advertised when a bio was created continue to be supported by the > device until that bio is ended - in practice this probably means that > a device's advertised crypto capabilities can *never* "shrink" (since > there's no synchronization between bio creation and when a device may > want to change its advertised capabilities) - so a previously > advertised crypto capability must always continue to be supported. > This function can be used to check that a new ksm is a valid > replacement for an old ksm. > > Signed-off-by: Satya Tangirala Looks good, you can add: Reviewed-by: Eric Biggers