Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2003 21:46:39 -0800
From:      "Luoqi Chen" <lchen@briontech.com>
To:        "Jeff Roberson" <jroberson@chesapeake.net>, <arch@FreeBSD.ORG>
Subject:   RE: vtruncbuf()
Message-ID:  <AHEKICEOIHLOGINAFIINOENMCAAA.lchen@briontech.com>
In-Reply-To: <20030303151503.N72102-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> vtruncbuf() does a few things that I'm not terribly certain I understand.
> I'm hoping someone can elaborate on this.
> 
> Once we have eliminated all bufs that are above the truncation mark we do
> a sort of inline sync of all indirect blocks.  Why do we have to do this
> sync? Is this required?  If so, why don't we just fsync here?  Or 
> require the
> filesystem to do it.  There are a few things that bother me about the
> current code there.
>
I think the idea was to avoid calling fsync.
 
> Firstly, it makes assumptions about negative blknos. So this scheme
> doesn't work for filesystems that don't use this method for indexing
> their metadata.
The code is a little ufs specific, but should still work for other FS
-- it doesn't hurt to write out dirty bufs.

> Secondly, it doesn't hold a lock while inspecting
> B_DELWRI.
>
It's intentional, see below...

> There is also a really weird check to see if the buf's vp matches the vp
> we're truncating.  This doesn't really make sense since we just 
> pulled this
> buf off of the dirty block lists for this vnode.
>
..., the buf is not locked, remember :)
 
> Comments please?
> 
> Thanks,
> Jeff
> 
 


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




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