Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp561350pxu; Fri, 23 Oct 2020 07:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMyMgcxPqL7gVxxN5qd3IQAiLIC4U/VTcL2O07T2S56vHDuEPNLgFrzFd8JzvYty3l4fCE X-Received: by 2002:aa7:ce13:: with SMTP id d19mr2546563edv.68.1603465016605; Fri, 23 Oct 2020 07:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603465016; cv=none; d=google.com; s=arc-20160816; b=B6He+dkrfDuwKHuKdvVj1hbAAjcn3WQt9kh7H71kQ4SOOwwlzX/BRFPLNRNqrkxjFk YevIoLyLPjh3VEabjzI0d6GRELW2eWND9EAgYQ2I8w4hPOwOh3HwIF71q1Myv6WEdeHZ 336xUe4W2lwfKtmawsEZbUzFB9KMCwyY3gQNgFJuPOrhbk0ND40/JSVauVQ9KQPSU/dT 3bbWdteZx8LhTxhG2p7ipLod8rpTvfF+yuvVULRXRgVXF7OHbQnUOKN29axmIrkKjr8D 7iNlwdvG1Ri5+H+1vjUlyyEoRm1nw0Ho5uQGNfN36x6KZhcmptILdFcBNWr3uG2EUlym Asww== 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=Bc/Tl7QrHQ8TS00H9eZHX8HpJf7gnLju80W3+dBio3s=; b=rD3vK4RVTU99RFLzwnvTwWjE8QNcjQ0ssUnwBWllf+y09DBK2sCWN46VhsOW4V8hZC ftNfNZFGwV3F1wSydi35nC0zc6Ajk24BwLKgWUGBtJ1FBTN7T6iHdjX2FhJRWipoX4G+ g8alBjpBbfaNB0JErChDOHkn+fE8/xtobORcaNh7t8H8TAFq7jD/95FgFyvGjCo/UreL Y6coXUVrZ49xRtsiw8jBAqLErnQuxoOQSESMPgV7AJhL57ffnZGuLHrYAI7+Bc2bhyi7 xLpj9r6CjJdvHsvC2pqbfiCLQETGLzfsABA9AqCM0cNCDW+LuSHm2c/x+UV3TSZsK6LL 9tNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="lHd/Y1XE"; 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 ec18si1003175ejb.679.2020.10.23.07.56.34; Fri, 23 Oct 2020 07:56:56 -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="lHd/Y1XE"; 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 S461223AbgJWJOM (ORCPT + 99 others); Fri, 23 Oct 2020 05:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S461183AbgJWJOL (ORCPT ); Fri, 23 Oct 2020 05:14:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C989C0613CE; Fri, 23 Oct 2020 02:14:11 -0700 (PDT) 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=Bc/Tl7QrHQ8TS00H9eZHX8HpJf7gnLju80W3+dBio3s=; b=lHd/Y1XEta78XOwzEbRgq/UpU2 A73VJLFqdMTxta2mKEIuA4xhXip9HWuId1knbAKvRkldwoW/HCUVhiDtojltIj8JcsLhWqCrMVJVu TWggv/tZBG2rywCZT9hxTZ1KWViMWFeX+/1jN8Q4GJNcQl/5tO1GpHlomoV7+s5pg4/GoXkBAHxXl N9bvOBR1/3BgkmHsIoiihX/L2LKkryJc3oI7y7muTeVt4v66HZE/jkji3cbb6myWrMgnKFX/EW0HI 3FYEGvf4D5QnGxvF83oZCyFuAF/SKnjGgp9x4wtd8xSoAh69Cgmt+1sg259JZHpXkc0NkMJbJafpJ P8zwFb2Q==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVt8s-0006xU-8j; Fri, 23 Oct 2020 09:13:46 +0000 Date: Fri, 23 Oct 2020 10:13:46 +0100 From: "hch@infradead.org" To: Mike Snitzer Cc: "Darrick J. Wong" , Sergei Shtepa , Damien Le Moal , Hannes Reinecke , "axboe@kernel.dk" , "viro@zeniv.linux.org.uk" , "hch@infradead.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "rjw@rjwysocki.net" , "len.brown@intel.com" , "pavel@ucw.cz" , "akpm@linux-foundation.org" , Johannes Thumshirn , "ming.lei@redhat.com" , "jack@suse.cz" , "tj@kernel.org" , "gustavo@embeddedor.com" , "bvanassche@acm.org" , "osandov@fb.com" , "koct9i@gmail.com" , "steve@sk2.org" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-mm@kvack.org" , device-mapper development , Alasdair G Kergon Subject: Re: [PATCH 0/2] block layer filter and block device snapshot module Message-ID: <20201023091346.GA25115@infradead.org> References: <1603271049-20681-1-git-send-email-sergei.shtepa@veeam.com> <71926887-5707-04a5-78a2-ffa2ee32bd68@suse.de> <20201021141044.GF20749@veeam.com> <20201022094402.GA21466@veeam.com> <20201022135213.GB21466@veeam.com> <20201022151418.GR9832@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Oct 22, 2020 at 01:54:16PM -0400, Mike Snitzer wrote: > On Thu, Oct 22, 2020 at 11:14 AM Darrick J. Wong > > Stupid question: Why don't you change the block layer to make it > > possible to insert device mapper devices after the blockdev has been set > > up? > > Not a stupid question. Definitely something that us DM developers > have wanted to do for a while. Devil is in the details but it is the > right way forward. > Yes, I think that is the right thing to do. And I don't think it should be all that hard. All we'd need in the I/O path is something like the pseudo-patch below, which will allow the interposer driver to resubmit bios using submit_bio_noacct as long as the driver sets BIO_INTERPOSED. diff --git a/block/blk-core.c b/block/blk-core.c index ac00d2fa4eb48d..3f6f1eb565e0a8 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1051,6 +1051,9 @@ blk_qc_t submit_bio_noacct(struct bio *bio) return BLK_QC_T_NONE; } + if (blk_has_interposer(bio->bi_disk) && + !(bio->bi_flags & BIO_INTERPOSED)) + return __submit_bio_interposed(bio); if (!bio->bi_disk->fops->submit_bio) return __submit_bio_noacct_mq(bio); return __submit_bio_noacct(bio);