From: Neil Brown <neilb@suse.de>
To: device-mapper development <dm-devel@redhat.com>
Cc: robertx.m.riches.jr@intel.com
Subject: Re: Is there a way to see updated contents of a DM target's underlying device while the DM target is in use?
Date: Thu, 1 Jul 2010 10:22:03 +1000 [thread overview]
Message-ID: <20100701102203.51d9a8fc@notabene.brown> (raw)
In-Reply-To: <4BD43A85686FC34D819098DB1C3999D99E4199BA@orsmsx502.amr.corp.intel.com>
On Wed, 30 Jun 2010 15:54:08 -0700
"Riches Jr, RobertX M" <robertx.m.riches.jr@intel.com> wrote:
> (New list member, just subscribed. Apologies if this is not the right list for this question.)
>
> Is there a way to see the updated contents of a DM target's underlying device while the DM target is in use? I Googled and searched in documentation and existing code for an answer but was not able to find it.
>
> Background:
>
> I'm debugging a DM target that does change-tracking. It's a combination of code from dm-linear, Alberto Bertogli's dm-csum, dm-delay, and some original code. (The project architect does intend to properly release it under GPL per the license of the incorporated GPL pieces.) The target reserves an early portion of the underlying device and exposes/creates/supports a device that is a linear mapping of the rest of the underlying device. The idea is each write to the exposed device sets a corresponding bit in the reserved portion, using the write barrier trick from dm-csum's 'same' mode, to indicate which parts of the exposed device have been modified and which have not. (I had earlier tried to use the userspace dirty-logging facility but found it to not meet our needs.)
>
> The target is intended to be used with LVM snapshots to do block-device-level backups. (I'm aware of filesystem-level issues with that, but the requirement is the requirement.) The underlying device for the DM target will be an LVM logical volume. The backup manager will send a dmsetup message to the DM target to hold all writes (and maybe reads) on indefinite delay, create an LVM snapshot of the DM target's underlying device, then flush the held bios and resume normal operation.
>
> Problem:
>
> The current problem I have is many updates are not visible in the DM target's underlying device until I do a 'dmsetup remove'. When I look at the underlying device (an LVM LV) prior to 'dmsetup remove', it's not reliable whether I see what has been written by the DM target. I have verified that the bios go out and the callbacks are called.
try blockdev --flushbufs
on the device before reading it.
Or issue the ioctl yourself.
Or use O_DIRECT to read.
I suspect you are reading from the page cache for the device, while dm-linear
reads/writes directly to the device avoiding the page cache.
NeilBrown
>
> Any suggestions toward being able to reliably see (as in copy out) data from the underlying device or making an LVM snapshot of it while my change-tracking DM target module is still in use?
>
> Thanks,
>
> Robert Riches
> Azad Consultant at Intel
>
>
next prev parent reply other threads:[~2010-07-01 0:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 22:54 Is there a way to see updated contents of a DM target's underlying device while the DM target is in use? Riches Jr, RobertX M
2010-06-30 23:08 ` Alasdair G Kergon
2010-06-30 23:53 ` Riches Jr, RobertX M
2010-07-01 0:51 ` Alasdair G Kergon
2010-07-01 1:01 ` Alasdair G Kergon
2010-07-01 1:03 ` Malahal Naineni
2010-07-01 1:49 ` Alasdair G Kergon
2010-07-01 16:46 ` Riches Jr, RobertX M
2010-07-01 19:00 ` Malahal Naineni
2010-07-02 14:52 ` Hannes Reinecke
2010-07-01 0:54 ` Malahal Naineni
2010-07-01 0:22 ` Neil Brown [this message]
2010-07-01 0:58 ` Malahal Naineni
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=20100701102203.51d9a8fc@notabene.brown \
--to=neilb@suse.de \
--cc=dm-devel@redhat.com \
--cc=robertx.m.riches.jr@intel.com \
/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.