All of lore.kernel.org
 help / color / mirror / Atom feed
From: "hch@infradead.org" <hch@infradead.org>
To: Mike Snitzer <snitzer@redhat.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Sergei Shtepa <sergei.shtepa@veeam.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>,
	Hannes Reinecke <hare@suse.de>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"hch@infradead.org" <hch@infradead.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"len.brown@intel.com" <len.brown@intel.com>,
	"pavel@ucw.cz" <pavel@ucw.cz>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"ming.lei@redhat.com" <ming.lei@redhat.com>,
	"jack@suse.cz" <jack@suse.cz>, "tj@kernel.org" <tj@kernel.org>,
	"gustavo@embeddedor.com" <gustavo@embeddedor.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"osandov@fb.com" <osandov@fb.com>,
	"koct9i@gmail.com" <koct9i@gmail.com>,
	"steve@sk2.org" <steve@sk2.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	device-mapper development <dm-devel@redhat.com>,
	Alasdair G Kergon <agk@redhat.com>
Subject: Re: [PATCH 0/2] block layer filter and block device snapshot module
Date: Fri, 23 Oct 2020 10:13:46 +0100	[thread overview]
Message-ID: <20201023091346.GA25115@infradead.org> (raw)
In-Reply-To: <CAMM=eLfO_L-ZzcGmpPpHroznnSOq_KEWignFoM09h7Am9yE83g@mail.gmail.com>

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);

WARNING: multiple messages have this Message-ID (diff)
From: "hch@infradead.org" <hch@infradead.org>
To: Mike Snitzer <snitzer@redhat.com>
Cc: "jack@suse.cz" <jack@suse.cz>,
	"gustavo@embeddedor.com" <gustavo@embeddedor.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	device-mapper development <dm-devel@redhat.com>,
	"pavel@ucw.cz" <pavel@ucw.cz>, "steve@sk2.org" <steve@sk2.org>,
	"osandov@fb.com" <osandov@fb.com>,
	Alasdair G Kergon <agk@redhat.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	"hch@infradead.org" <hch@infradead.org>,
	"len.brown@intel.com" <len.brown@intel.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"ming.lei@redhat.com" <ming.lei@redhat.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	Sergei Shtepa <sergei.shtepa@veeam.com>,
	"koct9i@gmail.com" <koct9i@gmail.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	Damien Le Moal <Damien.LeMoal@wdc.com>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"tj@kernel.org" <tj@kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [dm-devel] [PATCH 0/2] block layer filter and block device snapshot module
Date: Fri, 23 Oct 2020 10:13:46 +0100	[thread overview]
Message-ID: <20201023091346.GA25115@infradead.org> (raw)
In-Reply-To: <CAMM=eLfO_L-ZzcGmpPpHroznnSOq_KEWignFoM09h7Am9yE83g@mail.gmail.com>

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);

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2020-10-23  9:14 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  9:04 [PATCH 0/2] block layer filter and block device snapshot module Sergei Shtepa
2020-10-21  9:04 ` [PATCH 1/2] Block layer filter - second version Sergei Shtepa
2020-10-21  9:14   ` Johannes Thumshirn
2020-10-21 10:01     ` Sergei Shtepa
2020-10-21  9:21   ` Damien Le Moal
2020-10-21 10:27     ` Sergei Shtepa
2020-10-21 11:44     ` Matthew Wilcox
2020-10-21 12:55       ` Sergei Shtepa
2020-10-21 13:07         ` Matthew Wilcox
2020-10-21 14:35           ` Sergei Shtepa
2020-10-21 15:09   ` Randy Dunlap
2020-10-24 14:53   ` Greg KH
2020-10-21  9:04 ` [PATCH 2/2] blk-snap - snapshots and change-tracking for block devices Sergei Shtepa
2020-10-21  9:08   ` Pavel Machek
2020-10-21  9:37     ` Sergei Shtepa
2020-10-21  9:23   ` Damien Le Moal
2020-10-21 11:15     ` Sergei Shtepa
2020-10-21 10:48   ` kernel test robot
2020-10-21 10:48     ` kernel test robot
2020-10-21 15:11   ` Randy Dunlap
2020-10-21 13:31 ` [PATCH 0/2] block layer filter and block device snapshot module Hannes Reinecke
2020-10-21 14:10   ` Sergei Shtepa
2020-10-22  5:58     ` Hannes Reinecke
2020-10-22  9:44       ` Sergei Shtepa
2020-10-22 10:28         ` Damien Le Moal
2020-10-22 13:52           ` Sergei Shtepa
2020-10-22 15:14             ` Darrick J. Wong
2020-10-22 17:54               ` Mike Snitzer
2020-10-22 17:54                 ` [dm-devel] " Mike Snitzer
2020-10-22 17:54                 ` Mike Snitzer
2020-10-23  9:13                 ` hch [this message]
2020-10-23  9:13                   ` [dm-devel] " hch
2020-10-23 10:31                   ` Hannes Reinecke
2020-10-23 10:31                     ` [dm-devel] " Hannes Reinecke
2020-10-23 11:04                     ` Sergei Shtepa
2020-10-23 11:04                       ` [dm-devel] " Sergei Shtepa
2020-10-23 11:12                     ` hch
2020-10-23 11:12                       ` hch
2020-10-22 18:35 ` Mike Snitzer
2020-10-22 18:35   ` [dm-devel] " Mike Snitzer
2020-10-22 18:35   ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201023091346.GA25115@infradead.org \
    --to=hch@infradead.org \
    --cc=Damien.LeMoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=darrick.wong@oracle.com \
    --cc=dm-devel@redhat.com \
    --cc=gustavo@embeddedor.com \
    --cc=hare@suse.de \
    --cc=jack@suse.cz \
    --cc=koct9i@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sergei.shtepa@veeam.com \
    --cc=snitzer@redhat.com \
    --cc=steve@sk2.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.