From owner-freebsd-fs@FreeBSD.ORG Mon Feb 9 17:56:05 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09E1B1065700 for ; Mon, 9 Feb 2009 17:56:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 481468FC2D for ; Mon, 9 Feb 2009 17:56:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id DDCA546B2C; Mon, 9 Feb 2009 12:56:03 -0500 (EST) Date: Mon, 9 Feb 2009 17:56:03 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jaakko Heinonen In-Reply-To: <20090209155521.GA3418@a91-153-125-115.elisa-laajakaista.fi> Message-ID: References: <20090207200918.GA58657@test71.vk2pj.dyndns.org> <20090209155521.GA3418@a91-153-125-115.elisa-laajakaista.fi> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org, Peter Jeremy Subject: Re: Unable to pwd in ZFS snapshot X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:56:17 -0000 On Mon, 9 Feb 2009, Jaakko Heinonen wrote: > On 2009-02-08, Peter Jeremy wrote: >> I'm running -current from late last year (just after the ZFS v13 import) >> and have found that I can't determine the current working directory inside >> a snapshot: > > getcwd(3) first tries __getcwd() system call but it always fails because the > VFS name cache is not supported for .zfs control directories. Secondly > getcwd(3) tries to resolve working directory by traversing the directory > tree to root but this fails too because the .zfs directory is normally > hidden from the directory listing. (getcwd(3) uses readdir(3) to find > component names) Now that we have a new VOP to assist in reverse-name resolution, it could be that ZFS could provide the back-end lookup to address this issue without forcing the use of the namecache for things we don't want to cache. Robert N M Watson Computer Laboratory University of Cambridge