Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4287030pxf; Tue, 16 Mar 2021 09:45:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy/4TggMYgnxzXa/dV0v6ZM9TRoriTbWenWOyVLIlS8mXpMcrlYhhZGUkk+4yejJBz21yN X-Received: by 2002:a17:906:8a6e:: with SMTP id hy14mr31228898ejc.356.1615913107977; Tue, 16 Mar 2021 09:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615913107; cv=none; d=google.com; s=arc-20160816; b=u5I8gcB91u5r+Wvg6nxfXKtLbhvchxqwqeh29gwL2rrb8Sq/Rt8c1roGarQaowj1q3 jCQa4Z7ftmk6xY8uHJGbgfoEejdOzOOiUR88leW0wU2z5QcErmd0LqeWO8WUAjXcYW5P KX3/1PKwv3dd3vYEbIk2ZQuUSjKbkeRdOC7Ze73Ih/YnrzHVSE8Du/gm5xCmqJ+koJwS AZ1v6Kw+m5SuMNSYTTM2xl3Ko4LTfhdIKKTQEJfsNtjMmYV9iGqDWhj+nKgIbhhbyffD TQzabt5twYlfzSot1m5qURPgPfvrRBOBRVbTp+Z6RG46DWSlDrmXmw6BJCVrFJSmgOF1 gLLQ== 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=2LFHkTsbHPGvR5g6piEA0fvad3DcfT58cnGlmZRHYxs=; b=HsEJ154dkcq5O8b8/ukOuNIIi/h/7cHgOALFkvOpoDVbIHglmqAsfH9YipHOvVxhcO Kl/OrVcFZVYqMaUAfEYj+Zghoh7WsFvWq1/DPrrelsjx1oxy8OhuXdKuKjUaeMyQplJ+ +A+Z4JkBxNjHNKz4Ogv2muec1TCoKnQgtczvmCNPEUUbfSC76peZBMgw02EgwEWcoJvz cFY0kgXsiINlXqLe0gkMzE87t3E34Mqpn03xtSvoL24JiUFecSwUwmAWApNS78xL3Qdy 5EWUGix7sDMQQ4yiHIzdbJmeq/iEDw73O3PXvopW8qe+mmL3SPh2O4qpukTPXD0PJkwg SsYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SmkVxld2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc17si14432141ejc.480.2021.03.16.09.44.44; Tue, 16 Mar 2021 09:45:07 -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=@infradead.org header.s=casper.20170209 header.b=SmkVxld2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236207AbhCPPYC (ORCPT + 99 others); Tue, 16 Mar 2021 11:24:02 -0400 Received: from casper.infradead.org ([90.155.50.34]:37308 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbhCPPXh (ORCPT ); Tue, 16 Mar 2021 11:23:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2LFHkTsbHPGvR5g6piEA0fvad3DcfT58cnGlmZRHYxs=; b=SmkVxld2/3wHzaFeYQD+egXhSj L7BVcHR8AYpXEa7EaRy9Y6/uic1TmA6nuyXq6JLKgxEaRUBYbZ137cq6Id2jXRz+ZeoyfljtYwfdq mPv1APPaZDCodHCZSs6V4eo3q+LNv6rkbEDws06jEuEKHy/ncJ7lq/VKrG745fBs0A8YFKqyPu3O5 ARFJpkb5jRqrcPwp8ZyAWmDX8dWOPBRa+KidI3PgQuHz92dFfUXTGcwoIoBl86cvxV2866vJ8qBFf VtODKAayUQEul+uh4hdiVpvnaLEj02mN5+CsJC8vYCNsJpE2AwxCHMpwdaABruEODHwUhBZcneAX+ P1jUU5Lg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lMBXO-000EUG-5Z; Tue, 16 Mar 2021 15:23:15 +0000 Date: Tue, 16 Mar 2021 15:23:14 +0000 From: Christoph Hellwig To: Sergei Shtepa Cc: Christoph Hellwig , Mike Snitzer , Alasdair Kergon , Hannes Reinecke , Jens Axboe , "dm-devel@redhat.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , Pavel Tide Subject: Re: [PATCH v7 3/3] dm: add DM_INTERPOSED_FLAG Message-ID: <20210316152314.GA55391@infradead.org> References: <1615563895-28565-1-git-send-email-sergei.shtepa@veeam.com> <1615563895-28565-4-git-send-email-sergei.shtepa@veeam.com> <20210314093038.GC3773360@infradead.org> <20210315132509.GD30489@veeam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210315132509.GD30489@veeam.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 15, 2021 at 04:25:09PM +0300, Sergei Shtepa wrote: > The 03/14/2021 12:30, Christoph Hellwig wrote: > > On Fri, Mar 12, 2021 at 06:44:55PM +0300, Sergei Shtepa wrote: > > > DM_INTERPOSED_FLAG allow to create DM targets on "the fly". > > > Underlying block device opens without a flag FMODE_EXCL. > > > DM target receives bio from the original device via > > > bdev_interposer. > > > > This is more of a philopical comment, but the idea of just letting the > > interposed reopen the device by itself seems like a bad idea. I think > > that is probably better hidden in the block layer interposer attachment > > function, which could do the extra blkdev_get_by_dev for the caller. > > I suppose this cannot be implemented, since we need to change the behavior > for block devices that already have been opened. That's not what I mean. Take a look at the patch relative to your series to let me know what you think. The new blkdev_interposer_attach now takes a dev_t + mode for the original device and opens it on behalf of the interposer. It also moves the queue freezing into the API, which should address the concerns about the helper and adds a few more sanity checks.