Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp385323pxu; Fri, 23 Oct 2020 03:32:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqQthFnjWzRu52brweidJPsKlPjVmIF2suPuzLzSAOMrIIVsqXEDR7v3WwkCBjwEOcbKKk X-Received: by 2002:a17:906:1c0f:: with SMTP id k15mr1199576ejg.343.1603449169243; Fri, 23 Oct 2020 03:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603449169; cv=none; d=google.com; s=arc-20160816; b=jh2NsCWOkD1X6UtHiAm0mWXyQ8AJwoAwQUkehsw3IGdnWjvxkFq5N8iKWBexLkY13l LgdITZSeoIEwyNW47HlZhINKLy0+bgaJYYAH5TDZtt8SYjiivUvGolExBjKSTDg9gn+v 505mZt5hv4yV/dPMr7lujRdQ4S5iK7Af7u5nQPQ2/E2Hra4AUJcee8Miki+PXb2ESxFH cfrOkzVhn2AfbUk+3Iaxkp5lyUVGePQwkIUHEgK23+Oz8mBUxAam9EaOH2IBNfVPygED 9zc+2xBwY+/8E1ijBGh3eILa9epNF+9BCQCUhS8QUYwB9Yd9M8ebL6o9R5VG40x4IN9Y yP4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Pz4ViI7xVr8J/+aLYH2YMNxig3cZphFHkmU/nj51F1c=; b=z40/v6av4oSCcEHj1KNz4o9rWICEBk4g4RHfuhLtLg8eKbnbkgUGQdu2xUc63RBqyz EFaA5nuSsLI7D9uNhBalpl1hw9+jXdcN8+g+k7Ao5Rz79QtiAYU7FkgmCsLYOQ726I6w 6K6OI1i9WkoNXLz2qLQlko3ei3+KViswnmhbe1pTWCAeQ8BMJSIK+IVLlqBG0V+FnFlK nuauOaKmFslGV+kF3r++ZxXBJ2ZvJ/uJK8uErnfd37LzKQ2me129+jM5KIzK82tx8meB KK3sTgBQpQ8/rQnTKA2nSVy0rxI7EaK5EKtZTrqQPvRjONUbo/FYMy3uyZ/do+dn6umt n60A== ARC-Authentication-Results: i=1; mx.google.com; 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 rh15si542548ejb.496.2020.10.23.03.32.26; Fri, 23 Oct 2020 03:32:49 -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; 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 S462374AbgJWKbJ (ORCPT + 99 others); Fri, 23 Oct 2020 06:31:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:37798 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S462259AbgJWKbJ (ORCPT ); Fri, 23 Oct 2020 06:31:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A0192ABD1; Fri, 23 Oct 2020 10:31:07 +0000 (UTC) Subject: Re: [PATCH 0/2] block layer filter and block device snapshot module To: "hch@infradead.org" , Mike Snitzer Cc: "Darrick J. Wong" , Sergei Shtepa , Damien Le Moal , "axboe@kernel.dk" , "viro@zeniv.linux.org.uk" , "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 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> <20201023091346.GA25115@infradead.org> From: Hannes Reinecke Message-ID: Date: Fri, 23 Oct 2020 12:31:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201023091346.GA25115@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/23/20 11:13 AM, hch@infradead.org wrote: > 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); > My thoughts went more into the direction of hooking into ->submit_bio, seeing that it's a NULL pointer for most (all?) block drivers. But sure, I'll check how the interposer approach would turn out. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer