From owner-freebsd-fs@FreeBSD.ORG Sun Feb 14 08:49:19 2010 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 E0C9D106566C; Sun, 14 Feb 2010 08:49:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 9F29E8FC0A; Sun, 14 Feb 2010 08:49:19 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 555B421670A; Sun, 14 Feb 2010 10:49:14 +0200 (EET) Date: Sun, 14 Feb 2010 10:49:14 +0200 From: Jaakko Heinonen To: Gleb Kurtsou Message-ID: <20100214084913.GA974@a91-153-117-195.elisa-laajakaista.fi> References: <4b473c1f1002032014y4da8c0f0xcb74c749332cced3@mail.gmail.com> <20100204205546.GA1733@garage.freebsd.pl> <20100205011226.GA2657@tops.skynet.lt> <20100210200922.GA3109@a91-153-117-195.elisa-laajakaista.fi> <20100214010526.GA11217@tops.skynet.lt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100214010526.GA11217@tops.skynet.lt> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek 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: Sun, 14 Feb 2010 08:49:20 -0000 Hi, On 2010-02-14, Gleb Kurtsou wrote: > problem here lies in incorrect inode numbers (inconsistency between > VOP_READDIR and VOP_GETATTR). It's normal for mount points. This is problem for kernel vn_fullpath1()/vop_stdvptocnp() because ZFS clears VV_ROOT for snapshot root vnodes but I don't see this causing a problem in user space. > Fixing it only in kernel (__getcwd) doesn't necessarily fixes it for > all cases in userland, getcwd in our libc falls back to comparing > inode numbers User space getcwd() works just fine if the .zfs directory is visible (or am I missing something?). See the code in getcwd.c under comment "If it's a mount point, have to stat each element because the inode number in the directory is for the entry in the parent directory, not the inode number of the mounted file." User space getcwd() just can't work for hidden directories. > Fixing inode numbers would also fix pwd issues with namecache disabled. I don't think so. If the .zfs directory is hidden, vop_stdvptocnp() and user space getcwd() don't work. -- Jaakko