linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: "Jason A. Lixfeld" <jlixfeld@fastvibe.com>,
	ext3-users@redhat.com, linux-lvm@sistina.com
Subject: [linux-lvm] Re: What really works?
Date: Mon Oct 22 17:22:01 2001	[thread overview]
Message-ID: <20011022162326.G5146@turbolinux.com> (raw)
In-Reply-To: <20011022230524.B4212@redhat.com>

On Oct 22, 2001  23:05 +0100, Stephen C. Tweedie wrote:
> Just glancing over the LVM code, though, I don't think that their
> locking code is safe in the presence of other filesystem activity.  
>
> lvm_do_pe_lock_unlock does try to flush existing IO, but they do it
> with
> 
> 		pe_lock_req.lock = UNLOCK_PE;
> 		fsync_dev(pe_lock_req.data.lv_dev);
> 		pe_lock_req.lock = LOCK_PE;

Note that the code you reference is only in use when the Logical Extent
is being moved from one disk to another (shouldn't be done in normal
circumstances).  Also, this code has been reworked in the LVM CVS and
recent LVM releases to be more robust.

> which (a) doesn't wait for existing IO to complete if that IO was
> submitted externally to the buffer cache (so it won't catch
> raw IO, direct IO, journal activity, or RAID1 ios); and (b) it allows
> new IO to be submitted while the fsync is going on, so when it
> eventually sets LOCK_PE state again, we can have loads of new IO
> freshly submitted to the device by the time the lock is re-asserted.  

The "external I/O" problem is a known issue (raw IO) because it is not
flushed.  Note that in newer kernels, all write I/O which is done to
the LE being moved is put into a queue at LVM mapping time, so the
above fsync is not an issue for it (it gets resubmitted when the move
is done).

> LVM folks, am I missing something here?  I can't see how you can
> assert that the device is truly quiescent after the LOCK_PE has been
> set.  

See lvm_map() in newer LVM code for the _queue_io() calls.

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

  reply	other threads:[~2001-10-22 17:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E15vISM-0005YX-00.2001-10-21-14-15-58@mail5.svr.pol.co.uk>
2001-10-21 14:25 ` [linux-lvm] What really works? Jason A. Lixfeld
2001-10-22 14:37   ` [linux-lvm] " Theodore Tso
2001-10-22 14:42     ` Bryan-TheBS-Smith
2001-10-22 21:13     ` [linux-lvm] " Jason A. Lixfeld
2001-10-23  5:35       ` [linux-lvm] " Stephen C. Tweedie
2001-10-22 17:04   ` Stephen C. Tweedie
2001-10-22 17:22     ` Andreas Dilger [this message]
2001-10-23  5:32       ` Stephen C. Tweedie
2001-10-23  4:42     ` Joe Thornber
2001-11-02  9:40       ` Stephen C. Tweedie

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=20011022162326.G5146@turbolinux.com \
    --to=adilger@turbolabs.com \
    --cc=ext3-users@redhat.com \
    --cc=jlixfeld@fastvibe.com \
    --cc=linux-lvm@sistina.com \
    --cc=sct@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;
as well as URLs for NNTP newsgroup(s).