From owner-freebsd-fs@FreeBSD.ORG Sun Feb 14 10:30:11 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 7E82E1065672; Sun, 14 Feb 2010 10:30:11 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 52FA18FC0A; Sun, 14 Feb 2010 10:30:10 +0000 (UTC) Received: by fxm28 with SMTP id 28so227311fxm.31 for ; Sun, 14 Feb 2010 02:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ptplsyeNpjts/lHFaipDTrnQ1zcXY0KjlEaPPQbWCD8=; b=hOrh5VXgvu5syPGg3TZ3NHIkpxfgI8h1m/yrq1G3kLzbaMGVtzeTp1dO2IiEf/zsOC jXvUxjBFecijzgSQm3O/L6u8Kn7tFURcGCm57qYFtzPj8XXsjyfrLMeJIPMwRZSNs/z4 kzlHp1ze9w+U8O+Xw2xoOhe9UkHINWZ6t+OSw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=LuK0pnPZUBoe40h0MVGPzMl/oO0qnZNLs1BfOm08+LDQoa5lzfPNuZoC7ni9Tm2045 VyGG1J0wj/z95cQ8jPVg9PUHq5rM4YQGDdpL0i2rmLqKR/7cJhoz4oe/RYw/GAPkY3iw nsVBs2L2jKzcFeuqeuxFLSyoyhoY918QfR8iU= Received: by 10.223.81.90 with SMTP id w26mr4337631fak.9.1266143409424; Sun, 14 Feb 2010 02:30:09 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 21sm8301937fks.20.2010.02.14.02.30.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Feb 2010 02:30:08 -0800 (PST) Date: Sun, 14 Feb 2010 12:30:02 +0200 From: Gleb Kurtsou To: Jaakko Heinonen Message-ID: <20100214103001.GA1851@tops.skynet.lt> 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> <20100214084913.GA974@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100214084913.GA974@a91-153-117-195.elisa-laajakaista.fi> 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 10:30:11 -0000 On (14/02/2010 10:49), Jaakko Heinonen wrote: > > 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." Ah, now i see it. Sorry for extra noise. Thanks, Gleb. > 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