Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2002 10:09:39 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        Brian Somers <brian@freebsd-services.com>
Cc:        Maxim Sobolev <sobomax@FreeBSD.org>, Dag-Erling Smorgrav <des@ofug.org>, Kirk McKusick <mckusick@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern vfs_subr.c src/sys/ufs/ffs ffs_inode.c ffs_vfsops.c src/sys/ufs/ufs ufs_inode.c ufs_vnops.c
Message-ID:  <20020121100939.I13686@elvis.mu.org>
In-Reply-To: <200201211311.g0LDB1r91545@hak.lan.Awfulhak.org>; from brian@freebsd-services.com on Mon, Jan 21, 2002 at 01:11:00PM %2B0000
References:  <sobomax@FreeBSD.org> <200201211311.g0LDB1r91545@hak.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Brian Somers <brian@freebsd-services.com> [020121 05:11] wrote:
> 
> I believe this occurs because when a program does open(O_TRUNC), 
> write(), write(), write(), write(), write(), close(), each write 
> that's committed to the softupdates queue is actually some block 
> updates followed by an inode update.  Softupdates optimises out 
> the previous inode update.
> 
> The initial inode update isn't optimised out (the truncate) so that 
> the disk blocks can be freed easily.
> 
> So the queue ends up being:
> 
>   Make the file size 0
>   Do a *load* of block updates
>   Make the file size correct.
> 
> If you crash, you're *very* likely to end up with a zero length file.
> 
> This is unfortunate, and there's no easy way to avoid it.

Shouldn't editors fsync() files after ":w" ? :)

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020121100939.I13686>