Re: [RFC] ext3 freeze feature

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Takashi Sato <t-sato@...>, <linux-ext4@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, January 25, 2008 - 9:33 am

On Fri, Jan 25, 2008 at 03:18:51PM +0300, Dmitri Monakhov wrote:

Yes, but it requires that the filesystem be stored under LVM.  Unlike
what EVMS v1 allowed us to do, we can't currently take a snapshot of a
bare block device.  This patch could potentially be useful for systems
which aren't using LVM, however....


That's the problem.  You can't afford to freeze for very long.

What you *could* do is to start putting processes to sleep if they
attempt to write to the frozen filesystem, and then detect the
deadlock case where the process holding the file descriptor used to
freeze the filesystem gets frozen because it attempted to write to the
filesystem --- at which point it gets some kind of signal (which
defaults to killing the process), and the filesystem is unfrozen and
as part of the unfreeze you wake up all of the processes that were put
to sleep for touching the frozen filesystem.

The other approach would be to say, "oh well, the freeze ioctl is
inherently dangerous, and root is allowed to himself in the foot, so
who cares".  :-)

But it was this concern which is why ext3 never exported freeze
functionality to userspace, even though other commercial filesystems
do support this.  It wasn't that it wasn't considered, but the concern
about whether or not it was sufficiently safe to make available.

And I do agree that we probably should just implement this in
filesystem independent way, in which case all of the filesystems that
support this already have super_operations functions
write_super_lockfs() and unlockfs().

So if this is done using a new system call, there should be no
filesystem-specific changes needed, and all filesystems which support
those super_operations method functions would be able to provide this
functionality to the new system call.

      	      	     	    		      	 - Ted

P.S.  Oh yeah, it should be noted that freezing at the filesystem
layer does *not* guarantee that changes to the block device aren't
happening via mmap()'ed files.  The LVM needs to freeze writes the
block device level if it wants to guarantee a completely stable
snapshot image.  So the proposed patch doens't quite give you those
guarantees, if that was the intended goal.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] ext3 freeze feature, Takashi Sato, (Fri Jan 25, 6:59 am)
Re: [RFC] ext3 freeze feature, David Chinner, (Sat Jan 26, 1:35 am)
Re: [RFC] ext3 freeze feature, David Chinner, (Sat Jan 26, 1:39 am)
Re: [RFC] ext3 freeze feature, Dmitri Monakhov, (Fri Jan 25, 8:18 am)
Re: [RFC] ext3 freeze feature, Theodore Tso, (Fri Jan 25, 9:33 am)
Re: [RFC] ext3 freeze feature, Daniel Phillips, (Thu Jan 31, 4:53 am)
Re: [RFC] ext3 freeze feature, Eric Sandeen, (Fri Jan 25, 12:34 pm)
Re: [RFC] ext3 freeze feature, Theodore Tso, (Fri Jan 25, 12:42 pm)
Re: [RFC] ext3 freeze feature, Pavel Machek, (Sat Feb 2, 9:52 am)
Re: [RFC] ext3 freeze feature, Pekka Enberg, (Fri Jan 25, 7:17 am)