Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1528060pxv; Fri, 23 Jul 2021 10:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytd2JwuG+mLMfYM6iu8icqik7JhZ77J35BDYeFHZtMl8yFrLmt3J0d6XKZkwZHBUg+Wmg7 X-Received: by 2002:a5d:8b51:: with SMTP id c17mr799120iot.119.1627061274597; Fri, 23 Jul 2021 10:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627061274; cv=none; d=google.com; s=arc-20160816; b=xK3ba3QQf+NM41lkIBRSHvUwd+575+POCyLW5ja92Lh1eRJzCUFbUCvLthr9PAa8M/ rW/lv4DckU4Q93NNX6LYxsMuy0SIoyv17zD32b2BQKw194Lw+cuKOJjlkT0F9lkb+AmF PUaYR3ZB4j8CoY3OwYES5g57N28yw1ST/HvU1yDoo4hLJ2KdLtUNHdYgFkdZ5JlNVv8R MWLpXgSUE2NTNA9s4iCvbxflhEAFDgD6DpbllTQyGFA6yZwH5eXQ1HZLH74zgYHkX7TV pNrHypRbUDA5dmzIoC1XbqZaPcuHTe3ELw5XwQtbxqV0jpwYlP9wwLNPq4j9k2qoK7k8 zOwA== 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=ORXu7JyYAvRKJoeptrr0oHAJvHkFhbuMYbJtYCdDvd4=; b=TMTUpq1I11XI98GpmgVS6Ehudjhnx6eplFW5D2t5mCYrddmT+HLbxSJqHDi5JfYe5O XFydSIjXBdeKUWxMu08fhwe8htl7kJBrTL1OSmukClytqWIjIp+p+gZi/vbEgAzZY6Mv eeHkvmtozoMqfl/e+6TJFd2kU60lrD2OgD3ZuyQLIrkqzb6QU7PVEm7ApWfEX2g/fT4s 5BDV4OHhw84qD6JsWV9sH3sZiig1xRqwWi1bCmrJ9TfZK+cdHiVwbVsvKC5hWTsZNOrh QXbdImwfw7hPtEBgxcYe2Zf/3sQx8rwo1sfN0nk0HLxAPAYByWI12JRXEVwXBsPsqrWl iXkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qee8qdlw; 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 t26si15255436ioj.103.2021.07.23.10.27.41; Fri, 23 Jul 2021 10:27:54 -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=Qee8qdlw; 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 S231126AbhGWQqR (ORCPT + 99 others); Fri, 23 Jul 2021 12:46:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:45222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbhGWQqQ (ORCPT ); Fri, 23 Jul 2021 12:46:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60A2F60EB1; Fri, 23 Jul 2021 17:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627061209; bh=61tmtz2gl+/5WsyTpX2fSMaphxwIAinFjgKGpsgLcgw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qee8qdlwQxL4Dxje6UNCbGFj2WAGRxHe7xDwZKt9buwUuexQy2KhFFowzVEvIHZk/ gJ9eylrCtwCM85E0jVwV2ubesI2pSRQAPpqdZ0VY7Ygf7qa0arpoVRSssdFTQDefgR v8k6Ll2XfV/xLNWyM+IQKhLC2vWLGYIt62A4dXO22PhyIE8QdEauPXEo0zmTVg0MUd Rk+BPOsuqvelku8EhxLQ/a4eicOpV9xE6RnuNQR/bqwAt2s5LnVFHdvnXbJWGBHLgr eckzX+2UWnQGvlamdQN5G/zDXZN5/vYYx3eftT/4L3QbUjlXB7qAq89B0wRaJAIvCE lL/3QvmIG20mw== Date: Fri, 23 Jul 2021 10:26:48 -0700 From: Eric Biggers To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Satya Tangirala Subject: Re: [PATCH v4 7/9] dm: handle error from blk_ksm_register() Message-ID: References: <20210707052943.3960-1-satyaprateek2357@gmail.com> <20210707052943.3960-8-satyaprateek2357@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210707052943.3960-8-satyaprateek2357@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021 at 10:29:41PM -0700, Satya Tangirala wrote: > From: Satya Tangirala > > Handle any error from blk_ksm_register() in the callers. Previously, > the callers ignored the return value because blk_ksm_register() wouldn't > fail as long as the request_queue didn't have integrity support too, but > as this is no longer the case, it's safer for the callers to just handle > the return value appropriately. > > Signed-off-by: Satya Tangirala > --- > drivers/md/dm-table.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > index 29cbfc3e3c4b..c79c0fbe80dd 100644 > --- a/drivers/md/dm-table.c > +++ b/drivers/md/dm-table.c > @@ -1343,6 +1343,20 @@ static int dm_table_construct_keyslot_manager(struct dm_table *t) > */ > t->ksm = ksm; > > + /* > + * At this point, t->ksm is either NULL or *not* empty (i.e. will support > + * at least 1 crypto capability), the request queue doesn't support > + * integrity, and it also satisfies all the block layer constraints > + * "sufficiently" (as in the constraints of the DM device's request queue > + * won't preclude any of the intersection of the supported capabilities > + * of the underlying devices, since if some capability were precluded by > + * the DM device's request queue's constraints, that capability would > + * also have been precluded by one of the child device's request queues). > + * > + * Hence any future attempt to call blk_ksm_register() on t->ksm (if it's > + * not NULL) will succeed. > + */ > + > return 0; I don't think this properly answers the question I had on the previous version of this patch, which was not just how we know that blk_ksm_register() will succeed later, but also how we know that the blk_ksm_is_superset() check done above is valid when some of the crypto capabilities may be cleared by blk_ksm_register() later. Is the assumption actually that in the device-mapper case, blk_ksm_register() will never clear any crypto capabilities at all? If so, can that be explained properly? - Eric