From owner-freebsd-fs@FreeBSD.ORG Mon Feb 9 15:55:25 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 DCC9C106567B for ; Mon, 9 Feb 2009 15:55:25 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA388FC1B for ; Mon, 9 Feb 2009 15:55:25 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 62B132168FD; Mon, 9 Feb 2009 17:55:22 +0200 (EET) Date: Mon, 9 Feb 2009 17:55:21 +0200 From: Jaakko Heinonen To: Peter Jeremy Message-ID: <20090209155521.GA3418@a91-153-125-115.elisa-laajakaista.fi> References: <20090207200918.GA58657@test71.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090207200918.GA58657@test71.vk2pj.dyndns.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-fs@freebsd.org 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 15:55:26 -0000 Hi, 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) > This breaks (eg) make. I got around it by cloning the snapshot but > this behaviour strikes me as counter-intuitive (and the error message > leaves something to be desired). You can also work it around by making the ".zfs" directory visible: zfs set snapdir=visible volume -- Jaakko