From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9888C55178 for ; Fri, 23 Oct 2020 09:14:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D8DB124631 for ; Fri, 23 Oct 2020 09:14:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lHd/Y1XE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8DB124631 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BB7286B005D; Fri, 23 Oct 2020 05:14:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8D7F6B0062; Fri, 23 Oct 2020 05:14:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7D526B0068; Fri, 23 Oct 2020 05:14:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 7A7A66B005D for ; Fri, 23 Oct 2020 05:14:44 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 21626A8CA for ; Fri, 23 Oct 2020 09:14:44 +0000 (UTC) X-FDA: 77402630088.30.steel75_3e0176327258 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id E05EF180B3C83 for ; Fri, 23 Oct 2020 09:14:43 +0000 (UTC) X-HE-Tag: steel75_3e0176327258 X-Filterd-Recvd-Size: 4582 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Fri, 23 Oct 2020 09:14:43 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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);