From owner-freebsd-arch Mon Mar 3 12:24:24 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 086C537B405 for ; Mon, 3 Mar 2003 12:24:23 -0800 (PST) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CB5843F3F for ; Mon, 3 Mar 2003 12:24:22 -0800 (PST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h23KOLG83934 for ; Mon, 3 Mar 2003 15:24:21 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Mon, 3 Mar 2003 15:24:21 -0500 (EST) From: Jeff Roberson To: arch@freebsd.org Subject: vtruncbuf() Message-ID: <20030303151503.N72102-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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. 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. Secondly, it doesn't hold a lock while inspecting B_DELWRI. 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. Comments please? Thanks, Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message