From owner-freebsd-fs@FreeBSD.ORG Thu Feb 4 05:00: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 8EA891065670 for ; Thu, 4 Feb 2010 05:00:11 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by mx1.freebsd.org (Postfix) with ESMTP id B78808FC08 for ; Thu, 4 Feb 2010 05:00:10 +0000 (UTC) Received: by iwn8 with SMTP id 8so2285508iwn.13 for ; Wed, 03 Feb 2010 21:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pho76P14rnlZrGr+p2o0+yGfn4o7b1kzYDAix4aUhvk=; b=pviqJzCML/8ZeM2TlYNOwyrbZbqTpn28iJycaENqEzZkw4+ZsidL+d3Y8bFhZjkbtw b71R5eN0HetHrWeb0ztiz8ftIUuZm7NHm9MfuA8n/vfTGLw0yOg4IbgVPV+lMb64ZzJX VM6RJPSgrwEOmji4pUZBj2cINCRiIQXSgFSc0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=okDeHYHpTM2xe+Cx5QXXfd6CWJq+eEel1vZvuyd8xQRbKNwraceCk69b97d4EXpe3U /WbGqjEm5pzMRyDgTfA5nOc5uWO/8Lz7rKO5TJ1GDNnSYDNnyMXn+Z7h4Zy18Vr1+uzj U3tvaK3oNy+GdILM5aOtfioc00mHcD/sxY5yo= MIME-Version: 1.0 Received: by 10.231.150.2 with SMTP id w2mr980792ibv.90.1265259609895; Wed, 03 Feb 2010 21:00:09 -0800 (PST) In-Reply-To: <4b473c1f1002032014y4da8c0f0xcb74c749332cced3@mail.gmail.com> References: <4b473c1f1002032014y4da8c0f0xcb74c749332cced3@mail.gmail.com> Date: Wed, 3 Feb 2010 21:00:09 -0800 Message-ID: From: Freddie Cash To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Thu, 04 Feb 2010 05:00:11 -0000 On Wed, Feb 3, 2010 at 8:14 PM, Randy Sofia wrote: > `pwd` returns "No such file or directory" when browsing snapshot files. > This > was addressed in: > http://lists.freebsd.org/pipermail/fr > >> >> --randy >> _______________________________________________ >> freebsd-fs@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-fs >> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >> > eebsd-fs/2009-February/005675.html but > remains the same as of 8.0-RELEASE. > > I am wondering if this is the expected behavior or if this was left by the > wayside. > > A work around is available as per the previous discussion: > zfs set snapdir=visible volume > > Reproducible behavior: > CANAAN# zfs snapshot pithos/media@0_day_ago > CANAAN# cd /pithos/media/.zfs/snapshot/0_day_ago/ > CANAAN# pwd > pwd: .: No such file or directory > CANAAN# uname -a > FreeBSD CANAAN 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Fri Dec 18 00:38:33 UTC > 2009 root@:/usr/obj/usr/src/sys/CANAAN amd64 > I believe this is a "bug" in csh, in that it doesn't have a pwd shell built-in, and uses /bin/pwd. The real issue lies in /bin/pwd. It works correctly in sh, zsh, and bash, which each have pwd built-ins. As a workaround, use a non-csh-based shell. :) Doing a truss on /bin/pwd when in /home/.zfs/snapshot/2009-12-31 (I snapshot /home daily) gives the following with snapdir=hidden: __getcwd(0x28201400,1024) ERR#2 'No such file or directory' stat("/",{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) lstat(".",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) stat("..",{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) open("..",O_NONBLOCK,05001200603) = 3 (0x3) fstat(3,{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) __sysctl(0x84bfe6a8,0x2,0x281994bc,0x84bfe6b0,0x0,0x0) = 0 (0x0) fstatfs(0x3,0x84bfe780,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x28086400) = 1164 (0x48c) lstat("../2010-01-26",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-26",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-14",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-14",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-07",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-13",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-19",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-21",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-21",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-25",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-25",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-02-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-17",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-17",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-04",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-04",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-09",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-09",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-31",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-31",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../",{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) stat("../..",{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) open("../..",O_NONBLOCK,05001200603) = 3 (0x3) fstat(3,{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) fstatfs(0x3,0x84bfe780,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x6cd7212) = 44 (0x2c) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../../",{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) stat("../../..",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) open("../../..",O_NONBLOCK,03777777) = 3 (0x3) fstat(3,{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) fstatfs(0x3,0x84bfe780,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x6cd7212) = 56 (0x38) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x6cd7212) = 0 (0x0) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) And gives the following when snapdir=visible: __getcwd(0x28201400,1024) ERR#2 'No such file or directory' stat("/",{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) lstat(".",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) stat("..",{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) open("..",O_NONBLOCK,05001200603) = 3 (0x3) fstat(3,{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) __sysctl(0x84bfe6f8,0x2,0x281994bc,0x84bfe700,0x0,0x0) = 0 (0x0) fstatfs(0x3,0x84bfe7d0,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x28086400) = 1164 (0x48c) lstat("../2010-01-26",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-26",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-14",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-14",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-07",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-13",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-19",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-21",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-21",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-25",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-25",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-02-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-17",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-17",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-04",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-04",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-09",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-09",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-03",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2010-01-31",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lstat("../2009-12-31",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../",{ mode=dr-xr-xr-x ,inode=2,size=24,blksize=4096 }) = 0 (0x0) stat("../..",{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) open("../..",O_NONBLOCK,05001200603) = 3 (0x3) fstat(3,{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) fstatfs(0x3,0x84bfe7d0,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x6cd7212) = 44 (0x2c) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../../",{ mode=dr-xr-xr-x ,inode=1,size=3,blksize=4096 }) = 0 (0x0) stat("../../..",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) open("../../..",O_NONBLOCK,03777777) = 3 (0x3) fstat(3,{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) fstatfs(0x3,0x84bfe7d0,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x484328eb,0x6cd7212) = 72 (0x48) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../../../",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) stat("../../../..",{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) open("../../../..",O_NONBLOCK,03777777) = 3 (0x3) fstat(3,{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) fstatfs(0x3,0x84bfe7d0,0x1,0x0,0x3,0x28073c94) = 0 (0x0) fstat(3,{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) getdirentries(0x3,0x2820e000,0x1000,0x2820d054,0x489629aa,0x0) = 512 (0x200) lstat("../../../../.snap",{ mode=drwxrwxr-x ,inode=3,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../dev",{ mode=dr-xr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../etc",{ mode=drwxr-xr-x ,inode=141312,size=2560,blksize=4096 }) = 0 (0x0) lstat("../../../../cdrom",{ mode=drwxr-xr-x ,inode=211968,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../bin",{ mode=drwxr-xr-x ,inode=23552,size=1024,blksize=4096 }) = 0 (0x0) lstat("../../../../boot",{ mode=drwxr-xr-x ,inode=164864,size=1024,blksize=4096 }) = 0 (0x0) lstat("../../../../lib",{ mode=drwxr-xr-x ,inode=70656,size=2048,blksize=4096 }) = 0 (0x0) lstat("../../../../libexec",{ mode=drwxr-xr-x ,inode=117760,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../media",{ mode=drwxr-xr-x ,inode=94208,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../mnt",{ mode=drwxr-xr-x ,inode=188416,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../proc",{ mode=dr-xr-xr-x ,inode=117763,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../rescue",{ mode=drwxr-xr-x ,inode=23590,size=2560,blksize=4096 }) = 0 (0x0) lstat("../../../../root",{ mode=drwxr-xr-x ,inode=211969,size=1024,blksize=4096 }) = 0 (0x0) lstat("../../../../sbin",{ mode=drwxr-xr-x ,inode=47105,size=2560,blksize=4096 }) = 0 (0x0) lstat("../../../../tmp",{ mode=drwxrwxrwt ,inode=3,size=26,blksize=4096 }) = 0 (0x0) lstat("../../../../usr",{ mode=drwxr-xr-x ,inode=11,size=512,blksize=4096 }) = 0 (0x0) lstat("../../../../var",{ mode=drwxr-xr-x ,inode=3,size=25,blksize=4096 }) = 0 (0x0) lstat("../../../../restoresymtable",{ mode=-rw------- ,inode=4,size=1948892,blksize=4096 }) = 0 (0x0) lstat("../../../../sys",{ mode=lrwxr-xr-x ,inode=8,size=11,blksize=4096 }) = 0 (0x0) lstat("../../../../COPYRIGHT",{ mode=-r--r--r-- ,inode=12,size=6198,blksize=4096 }) = 0 (0x0) lstat("../../../../compat",{ mode=lrwxrwxrwx ,inode=7,size=10,blksize=4096 }) = 0 (0x0) lstat("../../../../home",{ mode=drwxr-xr-x ,inode=3,size=4,blksize=4096 }) = 0 (0x0) lseek(3,0x0,SEEK_SET) = 0 (0x0) close(3) = 0 (0x0) lstat("../../../../",{ mode=drwxr-xr-x ,inode=2,size=512,blksize=4096 }) = 0 (0x0) fstat(1,{ mode=crw--w---- ,inode=145,size=0,blksize=4096 }) = 0 (0x0) ioctl(1,TIOCGETA,0x84bfea10) = 0 (0x0) /home/.zfs/snapshot/2009-12-31 write(1,"/home/.zfs/snapshot/2009-12-31\n",31) = 31 (0x1f) -- Freddie Cash fjwcash@gmail.com