linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Sergei Shtepa <sergei.shtepa@veeam.com>
Cc: 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>
Subject: Re: [PATCH 0/2] block layer filter and block device snapshot module
Date: Thu, 22 Oct 2020 08:14:18 -0700	[thread overview]
Message-ID: <20201022151418.GR9832@magnolia> (raw)
In-Reply-To: <20201022135213.GB21466@veeam.com>

On Thu, Oct 22, 2020 at 04:52:13PM +0300, Sergei Shtepa wrote:
> The 10/22/2020 13:28, Damien Le Moal wrote:
> > On 2020/10/22 18:43, Sergei Shtepa wrote:
> > > 
> > > Maybe, but the problem is that I can't imagine how to implement
> > > dm-intercept yet. 
> > > How to use dm to implement interception without changing the stack
> > > of block devices. We'll have to make a hook somewhere, isn`t it?
> > 
> > Once your dm-intercept target driver is inserted with "dmsetup" or any user land
> > tool you implement using libdevicemapper, the "hooks" will naturally be in place
> > since the dm infrastructure already does that: all submitted BIOs will be passed
> > to dm-intercept through the "map" operation defined in the target_type
> > descriptor. It is then that driver job to execute the BIOs as it sees fit.
> > 
> > Look at simple device mappers like dm-linear or dm-flakey for hints of how
> > things work (driver/md/dm-linear.c). More complex dm drivers like dm-crypt,
> > dm-writecache or dm-thin can give you hints about more features of device mapper.
> > Functions such as __map_bio() in drivers/md/dm.c are the core of DM and show
> > what happens to BIOs depending on the the return value of the map operation.
> > dm_submit_bio() and __split_and_process_bio() is the entry points for BIO
> > processing in DM.
> > 
> 
> Is there something I don't understand? Please correct me.
> 
> Let me remind that by the condition of the problem, we can't change
> the configuration of the block device stack.
> 
> Let's imagine this configuration: /root mount point on ext filesystem
> on /dev/sda1.
> +---------------+
> |               |
> |  /root        |
> |               |
> +---------------+
> |               |
> | EXT FS        |
> |               |
> +---------------+
> |               |
> | block layer   |
> |               |
> | sda queue     |
> |               |
> +---------------+
> |               |
> | scsi driver   |
> |               |
> +---------------+
> 
> We need to add change block tracking (CBT) and snapshot functionality for
> incremental backup.
> 
> With the DM we need to change the block device stack. Add device /dev/sda1
> to LVM Volume group, create logical volume, change /etc/fstab and reboot.
> 
> The new scheme will look like this:
> +---------------+
> |               |
> |  /root        |
> |               |
> +---------------+
> |               |
> | EXT FS        |
> |               |
> +---------------+
> |               |
> | LV-root       |
> |               |
> +------------------+
> |                  |
> | dm-cbt & dm-snap |
> |                  |
> +------------------+
> |               |
> | sda queue     |
> |               |
> +---------------+
> |               |
> | scsi driver   |
> |               |
> +---------------+
> 
> But I cannot change block device stack. And so I propose a scheme with
> interception.
> +---------------+
> |               |
> |  /root        |
> |               |
> +---------------+
> |               |
> | EXT FS        |
> |               |
> +---------------+   +-----------------+
> |  |            |   |                 |
> |  | blk-filter |-> | cbt & snapshot  |
> |  |            |<- |                 |
> |  +------------+   +-----------------+
> |               |
> | sda blk queue |
> |               |
> +---------------+
> |               |
> | scsi driver   |
> |               |
> +---------------+
> 
> Perhaps I can make "cbt & snapshot" inside the DM, but without interception
> in any case, it will not work. Isn't that right?

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?

--D

> 
> -- 
> Sergei Shtepa
> Veeam Software developer.

  reply	other threads:[~2020-10-22 15:15 UTC|newest]

Thread overview: 29+ 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
     [not found] ` <1603271049-20681-3-git-send-email-sergei.shtepa@veeam.com>
2020-10-21  9:08   ` [PATCH 2/2] blk-snap - snapshots and change-tracking for block devices Pavel Machek
2020-10-21  9:37     ` Sergei Shtepa
     [not found]   ` <BL0PR04MB65142D9F391FE8777F096EF5E71C0@BL0PR04MB6514.namprd04.prod.outlook.com>
2020-10-21 11:15     ` Sergei Shtepa
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 [this message]
2020-10-22 17:54               ` Mike Snitzer
2020-10-23  9:13                 ` hch
2020-10-23 10:31                   ` Hannes Reinecke
2020-10-23 11:04                     ` Sergei Shtepa
2020-10-23 11:12                     ` [dm-devel] " hch
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=20201022151418.GR9832@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=gustavo@embeddedor.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).