lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201022135213.GB21466@veeam.com>
Date:   Thu, 22 Oct 2020 16:52:13 +0300
From:   Sergei Shtepa <sergei.shtepa@...am.com>
To:     Damien Le Moal <Damien.LeMoal@....com>
CC:     Hannes Reinecke <hare@...e.de>,
        "axboe@...nel.dk" <axboe@...nel.dk>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "hch@...radead.org" <hch@...radead.org>,
        "darrick.wong@...cle.com" <darrick.wong@...cle.com>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>,
        "len.brown@...el.com" <len.brown@...el.com>,
        "pavel@....cz" <pavel@....cz>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        Johannes Thumshirn <Johannes.Thumshirn@....com>,
        "ming.lei@...hat.com" <ming.lei@...hat.com>,
        "jack@...e.cz" <jack@...e.cz>, "tj@...nel.org" <tj@...nel.org>,
        "gustavo@...eddedor.com" <gustavo@...eddedor.com>,
        "bvanassche@....org" <bvanassche@....org>,
        "osandov@...com" <osandov@...com>,
        "koct9i@...il.com" <koct9i@...il.com>,
        "steve@....org" <steve@....org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH 0/2] block layer filter and block device snapshot module

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?

-- 
Sergei Shtepa
Veeam Software developer.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ