Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: "Kasatkin, Dmitry" <dmitry.kasatkin@intel.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	mpatocka@redhat.com, Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: dm-bufio
Date: Fri, 23 Mar 2012 10:32:55 -0400	[thread overview]
Message-ID: <20120323143254.GG7220@redhat.com> (raw)
In-Reply-To: <CALLzPKa1qoaRcWzeh2sTz9PFhYmPSgpGicL0dQ3w1rsP4XhGUQ@mail.gmail.com>

On Fri, Mar 23 2012 at 10:29am -0400,
Kasatkin, Dmitry <dmitry.kasatkin@intel.com> wrote:

> On Fri, Mar 23, 2012 at 4:21 PM, Mike Snitzer <snitzer@redhat.com> wrote:
> > On Fri, Mar 23 2012 at 10:12am -0400,
> > Kasatkin, Dmitry <dmitry.kasatkin@intel.com> wrote:
> >
> >> On Fri, Mar 23, 2012 at 1:26 PM, Kasatkin, Dmitry
> >> <dmitry.kasatkin@intel.com> wrote:
> >> > On Fri, Mar 23, 2012 at 1:10 PM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
> >> >> Dne 23.3.2012 12:01, Kasatkin, Dmitry napsal(a):
> >> >>> Hello,
> >> >>>
> >> >>> When using dm-bufio and dm-io in general, how to ensure that all dirty
> >> >>> buffers are written to the storage when machine reboots?
> >> >>> suspend hooks could be used, but they are not called on reboot, only
> >> >>> when suspending/removing the target...
> >> >>>
> >> >>
> >> >> You mean you reboot without running  'sync' command?
> >> >>
> >> >> And yes - on reboot you should properly unmount devices - so you should
> >> >> see removal of target on your shutdown sequence -  I believe Fedora currently
> >> >> tries to support switch to some shutdown ramdisk, so all filesystem and
> >> >> devices might be properly unmounted and destroyed.
> >> >>
> >> >
> >> > Hello,
> >> >
> >> > Thanks for response.
> >> > I use bufio to store some data on block device.
> >> > It is not mounted in anyway. My target just use it to load/store data.
> >> > When machine reboots, I want to be sure that bufio written all dirty buffers...
> >> >
> >> > - Dmitry
> >> >
> >>
> >> At the moment, I have reboot notifier which does the following
> >>
> >>       dm_bufio_write_dirty_buffers(d->bufio);
> >>       sync_blockdev(d->dev->bdev);
> >>       blkdev_issue_flush(d->dev->bdev, GFP_KERNEL, NULL);
> >>
> >> without first line on the next boot I got corrupted/not updated blocks.
> >> and I am not sure if I need last 2 lines...
> >
> > Are you cleanly removing the target from the kernel before reboot
> > (e.g. dmsetup remove devname)?
> >
> > As long as your target's .dtr is making sure to flush all outstanding IO
> > (like your reboot notifier does) you should be fine.
> >
> 
> The target contains rootfs... On reboot, it is remounted read-only.
> I cannot remove it...
> 
> Sometime ago I had "message" operation "sync", to sync backing devices.
> But reboot notifier looks nice... It is automatically called.

OK.

As an aside, just curious: what does your target do?

  reply	other threads:[~2012-03-23 14:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 11:01 dm-bufio Kasatkin, Dmitry
2012-03-23 11:10 ` dm-bufio Zdenek Kabelac
2012-03-23 11:26   ` dm-bufio Kasatkin, Dmitry
2012-03-23 14:12     ` dm-bufio Kasatkin, Dmitry
2012-03-23 14:21       ` dm-bufio Mike Snitzer
2012-03-23 14:29         ` dm-bufio Kasatkin, Dmitry
2012-03-23 14:32           ` Mike Snitzer [this message]
2012-03-23 15:17             ` dm-bufio Kasatkin, Dmitry
2012-03-23 21:32               ` dm-bufio Mike Snitzer
2012-03-24  0:04                 ` dm-bufio Kasatkin, Dmitry
2012-03-23 16:22       ` dm-bufio Mikulas Patocka
2012-03-23 23:58         ` dm-bufio Kasatkin, Dmitry
2012-03-24  1:07           ` dm-bufio Mikulas Patocka
2012-03-24 18:51             ` dm-bufio Will Drewry
2012-03-27 10:20               ` dm-bufio Kasatkin, Dmitry
2012-03-27  9:56             ` dm-bufio Kasatkin, Dmitry
  -- strict thread matches above, loose matches on Subject: below --
2011-10-14 19:14 [PATCH] dm-bufio Mikulas Patocka
2011-10-17 10:08 ` Joe Thornber
2011-10-17 12:41   ` dm-bufio Mike Snitzer
2011-10-13 15:05 dm-bufio Mikulas Patocka
2011-10-13 19:40 ` dm-bufio Mike Snitzer
2011-10-13 22:19   ` dm-bufio Mikulas Patocka
2011-10-13 22:31     ` dm-bufio Mike Snitzer
2011-10-14  9:19       ` dm-bufio Joe Thornber
2011-10-14  9:15 ` dm-bufio Joe Thornber
2011-10-14 12:19   ` dm-bufio Joe Thornber
2011-10-17 16:49   ` dm-bufio Mikulas Patocka
2011-10-17 18:01     ` dm-bufio Joe Thornber
2011-09-27 17:20 dm-bufio Mikulas Patocka
2011-09-28  9:41 ` dm-bufio Joe Thornber
2011-09-28  9:51 ` dm-bufio Heinz Mauelshagen

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=20120323143254.GG7220@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=dmitry.kasatkin@intel.com \
    --cc=mpatocka@redhat.com \
    --cc=zkabelac@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox