From owner-freebsd-fs Mon Nov 4 0:45:44 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4796337B401; Mon, 4 Nov 2002 00:45:43 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1065B43E7B; Mon, 4 Nov 2002 00:45:43 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id E451FAE27E; Mon, 4 Nov 2002 00:45:42 -0800 (PST) Date: Mon, 4 Nov 2002 00:45:42 -0800 From: Alfred Perlstein To: fs@freebsd.org Cc: Kirk McKusick , Poul-Henning Kamp Subject: statfs and how do show the users that they are using ufs2 vs ufs1? Message-ID: <20021104084542.GS24139@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I recently had the (mis)fortune of having to redo my filesystems and I noticed that there doesn't seem to be an indicator of the filesystem I've created/mounted being either ufs1 or ufs2. As I started to drill down in the code I noticed some reentrancy problems with the way that statfs(2) is done. The kernel API allows/encourages one to pass the cached statfs structure hung off of the mount structure into the VFS_STATFS call. This can/will cause races in the code once Giant is pushed down into VFS. So I'm wondering: .) Do we really need the cached statfs structure? (I think leaving it is probably ok and will require less code changes) .) Shouldn't we have a generic routine to copy in the constant values from the struct mount->statfs that the filesystem specific STATFS routine can call? (although we could add the call automagically to the VFS_STATFS macro.) .) Shouldn't we stop passing in the 'cached' structure into the STATFS routine? (i think we should stop, it causes reentrancy issues) .) Any problems with me taking a shot at making the statfs structure for ufs2 mounts have the string "ufs2" instead of "ufs"? (Any gotchas I should be aware of for this?) Suggestions and comments appreciated. thanks, -- -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.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message