[linux-lvm] How well tested is the snapshot feature?

Dale Stephenson dale.stephenson at quantum.com
Fri Jun 7 10:30:02 UTC 2002


I'm one of those people using LVM1 snapshots mostly successfully with XFS.
However:

1) I'm using a process flag hack to keep XFS's filesystem freeze from
snagging writes by kupdated, xfs_freeze, and fsync_dev/fsync_dev_lockfs.
I've also removed the xfs_unmountfs_writesb() call from xfs_thaw().  I'm
included the two patches I use, which apply against XFS 1.1.  I've directed
most of my discussion of this to the XFS list, as the locking mechanism is
filesystem-specific.  The only filesystem calls that the lvm driver makes
with the VFS patch are fsync_dev_lockfs() and unlockfs().  The COW activity
itself is done through brw_kiovec(), which I believe should not go through
the file system at all (though it seems to cause lots of indirect file
system activity through kupdated).

device-mapper (LVM2) uses (with VFS enhancement) the very same
fsync_dev_lockfs() and unlockfs() calls.  However, the COW activity is not
handled through brw_kiovec(), instead being transferred to device-mapper's
kcopyd.  I haven't worked with LVM2 yet, so it's certainly possible that
kcopyd allieviates the pressure on kupdated.  But in theory I would expect
it to be susceptible to the same file system deadlocks experienced by LVM1.


2) I'm still seeing an occasional xfs_freeze deadlock.
xfs_unmountfs_writesb() (from xfs_freeze) and kupdated get stuck on separate
pagebuf locks.  It occurs with multiple snapshots and streaming writes to
the snapshot source over both samba and nfs.

Using these patches, I haven't seen any oops problems, only the odd
deadlock.  You also have to mount the XFS snapshots with nouuid and
norecovery options.

Another approach that will work is to forget using the VFS patch entirely,
and use writeable snapshots (available for 1.1, LVM2, and working patches
have been posted to the list for 1.0.x).  If the snapshot is writeable you
can just mount with nouuid (or change the UUID of the snapshot), mount the
snapshot and let XFS recovery do its stuff.  This has the advantage of not
running into any locking problems whatsoever.  The disadvantage is that the
filesystem isn't clean, so instead of having a snapshot of the filesystem at
that point of time, you have the filesystem as if the power had suddenly
failed at that point in time.

Dale Stephenson
steph at snapserver.com

> -----Original Message-----
> From: Joe Thornber [mailto:joe at fib011235813.fsnet.co.uk]
> Sent: Friday, June 07, 2002 2:45 AM
> To: linux-lvm at sistina.com
> Subject: Re: [linux-lvm] How well tested is the snapshot feature?
> 
> 
> On Fri, Jun 07, 2002 at 11:37:05AM +0200, Stephan Austermuehle wrote:
> > On Fri, Jun 07, 2002 at 10:33:00AM +0100, Joe Thornber wrote:
> > 
> > > Did you apply the VFS patch from the 1.0.3 release ?  This makes
> > > sure that the filesystem flushes a consistent state to the disk
> > > before the snapshot is setup.
> > 
> > Do you mean the VFS lock patch? Yes, it is applied.
> 
> Curious, as far as I know people are using LVM1 snapshots successfully
> with xfs.
> 
> - Joe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_freeze.patch
Type: application/octet-stream
Size: 3154 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20020607/48edb63f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_freeze_lockfs.patch
Type: application/octet-stream
Size: 2072 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20020607/48edb63f/attachment-0001.obj>


More information about the linux-lvm mailing list