Subject: Re: File Size Limitations
To: Pavel Cahyna <pavel.cahyna@st.mff.cuni.cz>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 01/20/2005 16:22:34
[ On Wednesday, January 19, 2005 at 20:49:06 (+0100), Pavel Cahyna wrote: ]
> Subject: Re: File Size Limitations
>
> How can any soft updates mechanism guarantee that e.g. the rename
> operation, which is supposed to be atomic, will not leave both 
> names (the old one and the new one) if it is interrupted by a crash in the
> middle?

The same way any filesystem not using soft updates does.

I.e. it relies on fsck, and ultimately the administrator.  ;-)

All that soft updates do is defer metadata writes so that they can be
aggregated, but it still does them all in the correct order so that fsck
can help recover from such an untimely crash.

Without soft updates something like a rename or unlink required
_immediate_ disk activity to update metadata on-disk before the system
call returns, but with soft updates those writes are deferred so that
something like 'rm -rf' can run at blinding speed and yet still not
leave behind an un-fsck-able pile of garbage should the power fail in
the middle of those writes.

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>