From mharo@bitsurf.net  Thu Jul 21 07:03:06 2011
Return-Path: <mharo@bitsurf.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A6361065679
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Jul 2011 07:03:06 +0000 (UTC)
	(envelope-from mharo@bitsurf.net)
Received: from backups.mtv.bitsurf.net (173-164-184-53-SFBA.hfc.comcastbusiness.net [173.164.184.53])
	by mx1.freebsd.org (Postfix) with ESMTP id 408948FC23
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Jul 2011 07:03:05 +0000 (UTC)
Received: from backups.mtv.bitsurf.net (localhost [127.0.0.1])
	by backups.mtv.bitsurf.net (8.14.4/8.14.4) with ESMTP id p6L6bL4Q059464
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Jul 2011 23:37:21 -0700 (PDT)
	(envelope-from mharo@backups.mtv.bitsurf.net)
Received: (from mharo@localhost)
	by backups.mtv.bitsurf.net (8.14.5/8.14.5/Submit) id p6L6bLcT059463;
	Wed, 20 Jul 2011 23:37:21 -0700 (PDT)
	(envelope-from mharo)
Message-Id: <201107210637.p6L6bLcT059463@backups.mtv.bitsurf.net>
Date: Wed, 20 Jul 2011 23:37:21 -0700 (PDT)
From: Michael Haro <mharo@freebsd.org>
Reply-To: Michael Haro <mharo@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Can't cd .. with latest zfs version
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         159077
>Category:       kern
>Synopsis:       [zfs] Can't cd .. with latest zfs version
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 21 07:10:07 UTC 2011
>Closed-Date:    
>Last-Modified:  Wed May 02 17:44:26 UTC 2012
>Originator:     Michael Haro
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD backups.mtv.bitsurf.net 8.2-STABLE FreeBSD 8.2-STABLE #1: Sat Jul 16 19:26:28 PDT 2011 root@backups.mtv.bitsurf.net:/usr/obj/usr/src/sys/KERNEL amd64


freebsd 8.2 stable as of july 16th
zpool version 28
zfs version 3

>Description:

trying to cd up one level using 'cd ..' gives permission denied
	
>How-To-Repeat:

use sh or tcsh, not bash...

$ pwd
/home/mharo
$ cd ..
cd: can't cd to ..
$ ls -ald /home
drwxr-xr-x  4 root  wheel  4 Nov 29  2009 /home
$ ls -ald /home/mharo
drwxr-xr-x  3 mharo  users  15 Jul 20 22:49 /home/mharo
$ cd /home
$ pwd
/home
$ ls -ald mharo
drwxr-xr-x  3 mharo  users  15 Jul 20 22:49 mharo
$ cd mharo
$ cd ..
cd: can't cd to ..

so obviously I can cd into /home, just not via ..

$ zfs list -r zroot/home
NAME               USED  AVAIL  REFER  MOUNTPOINT
zroot/home         162K  2.70G    26K  /home
zroot/home/mharo   119K  2.70G  35.5K  /home/mharo

$ zpool get version zroot
NAME   PROPERTY  VALUE    SOURCE
zroot  version   28       default
$ zfs get version zroot/home
NAME        PROPERTY  VALUE    SOURCE
zroot/home  version   3        -
$ zfs get version zroot/home/mharo
NAME              PROPERTY  VALUE    SOURCE
zroot/home/mharo  version   3        -

I don't recall seeing this problem before I upgraded from zpool version 15 and
a 8-stable from january, but that doesn't mean it didn't exist.


>Fix:

unknown


>Release-Note:
>Audit-Trail:

From: Glen Barber <glen.j.barber@gmail.com>
To: Michael Haro <mharo@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/159077: Can't cd .. with latest zfs version
Date: Thu, 21 Jul 2011 09:49:34 -0400

 Hi,
 
 On 7/21/11 2:37 AM, Michael Haro wrote:
 > $ zfs get version zroot/home
 > NAME        PROPERTY  VALUE    SOURCE
 > zroot/home  version   3        -
 > $ zfs get version zroot/home/mharo
 > NAME              PROPERTY  VALUE    SOURCE
 > zroot/home/mharo  version   3        -
 > 
 
 Are your kernel and userland in sync?  I believe with ZFS v28 the ZFS
 version should be 4, not 3.  May not be the problem though.
 
 Regards,
 
 -- 
 Glen Barber
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jul 21 15:50:23 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159077 

From: Michael Haro <mharo@FreeBSD.org>
To: Glen Barber <glen.j.barber@gmail.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/159077: Can't cd .. with latest zfs version
Date: Thu, 21 Jul 2011 20:43:28 -0700

 --90e6ba53acd8ebd2a304a8a045f3
 Content-Type: text/plain; charset=ISO-8859-1
 
 On Thu, Jul 21, 2011 at 6:49 AM, Glen Barber <glen.j.barber@gmail.com>wrote:
 
 > Hi,
 >
 > On 7/21/11 2:37 AM, Michael Haro wrote:
 > > $ zfs get version zroot/home
 > > NAME        PROPERTY  VALUE    SOURCE
 > > zroot/home  version   3        -
 > > $ zfs get version zroot/home/mharo
 > > NAME              PROPERTY  VALUE    SOURCE
 > > zroot/home/mharo  version   3        -
 > >
 >
 > Are your kernel and userland in sync?  I believe with ZFS v28 the ZFS
 > version should be 4, not 3.  May not be the problem though.
 >
 
 Kernel and userland were both build and installed on the same day; I just
 haven't run zfs upgrade yet.  Is that required for cd .. to work?
 
 
 >
 > Regards,
 >
 > --
 > Glen Barber
 >
 
 --90e6ba53acd8ebd2a304a8a045f3
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <br><br><div class=3D"gmail_quote">On Thu, Jul 21, 2011 at 6:49 AM, Glen Ba=
 rber <span dir=3D"ltr">&lt;<a href=3D"mailto:glen.j.barber@gmail.com">glen.=
 j.barber@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quot=
 e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"=
 >
 
 Hi,<br>
 <br>
 On 7/21/11 2:37 AM, Michael Haro wrote:<br>
 &gt; $ zfs get version zroot/home<br>
 &gt; NAME =A0 =A0 =A0 =A0PROPERTY =A0VALUE =A0 =A0SOURCE<br>
 &gt; zroot/home =A0version =A0 3 =A0 =A0 =A0 =A0-<br>
 &gt; $ zfs get version zroot/home/mharo<br>
 &gt; NAME =A0 =A0 =A0 =A0 =A0 =A0 =A0PROPERTY =A0VALUE =A0 =A0SOURCE<br>
 &gt; zroot/home/mharo =A0version =A0 3 =A0 =A0 =A0 =A0-<br>
 &gt;<br>
 <br>
 Are your kernel and userland in sync? =A0I believe with ZFS v28 the ZFS<br>
 version should be 4, not 3. =A0May not be the problem though.<br></blockquo=
 te><div><br></div><div>Kernel and userland were both build and installed on=
  the same day; I just haven&#39;t run zfs upgrade yet. =A0Is that required =
 for cd .. to work?</div>
 
 <div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
 border-left:1px #ccc solid;padding-left:1ex;">
 <br>
 Regards,<br>
 <br>
 --<br>
 <font color=3D"#888888">Glen Barber<br>
 </font></blockquote></div><br>
 
 --90e6ba53acd8ebd2a304a8a045f3--

From: Glen Barber <glen.j.barber@gmail.com>
To: Michael Haro <mharo@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/159077: Can't cd .. with latest zfs version
Date: Fri, 22 Jul 2011 09:39:12 -0400

 On 7/21/11 11:43 PM, Michael Haro wrote:
 >> Are your kernel and userland in sync?  I believe with ZFS v28 the ZFS
 >> version should be 4, not 3.  May not be the problem though.
 >>
 > 
 > Kernel and userland were both build and installed on the same day; I just
 > haven't run zfs upgrade yet.  Is that required for cd .. to work?
 > 
 
 I wouldn't expect it to be, but perhaps that is the cause of the problem
 you are seeing.
 
 -- 
 Glen Barber

From: Martin Matuska <mm@FreeBSD.org>
To: bug-followup@FreeBSD.org, mharo@freebsd.org
Cc:  
Subject: Re: kern/159077: [zfs] Can&#39;t cd .. with latest zfs version
Date: Sat, 23 Jul 2011 11:28:55 +0200

 It should work with zpl version 3 (no need to do zfs upgrade) and I have
 never seen this before.
 Is there any way to reproduce this or take a closer look?
 
 -- 
 Martin Matuska
 FreeBSD committer
 http://blog.vx.sk
 

From: Fabian Keil <freebsd-listen@fabiankeil.de>
To: bug-followup@FreeBSD.org, mharo@freebsd.org
Cc:  
Subject: Re: kern/159077: [zfs] Can't cd .. with latest zfs version
Date: Sat, 23 Jul 2011 13:43:26 +0200

 --Sig_/Dci3z9B3kZCsY_I=wEyT+/a
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable
 
 Do you have the problem in every directory or only in some?
 Can you "cd .." as root?
 Does the '..' link exist and is it accessible?
 
 I ask because the problem looks familiar to me:
 
 fk@r500 ~/git/privoxy $/usr/bin/cd ..
 cd: ..: No such file or directory
 
 fk@r500 ~/git/privoxy $stat -x ..
 stat: ..: stat: Permission denied
 
 fk@r500 ~/git/privoxy $sudo stat -x ..
   File: ".."
   Size: 33           FileType: Directory
   Mode: (0755/drwxr-xr-x)         Uid: ( 1001/      fk)  Gid: ( 1001/      =
 fk)
 Device: 113,472580146   Inode: 3    Links: 33
 Access: Fri Mar 12 23:05:31 2010
 Modify: Sat Jul 23 13:26:27 2011
 Change: Sat Jul 23 13:26:27 2011
 
 fk@r500 ~/git/privoxy $stat -x ~/git/
   File: "/home/fk/git/"
   Size: 33           FileType: Directory
   Mode: (0755/drwxr-xr-x)         Uid: ( 1001/      fk)  Gid: ( 1001/      =
 fk)
 Device: 113,472580146   Inode: 3    Links: 33
 Access: Fri Mar 12 23:05:31 2010
 Modify: Sat Jul 23 13:26:27 2011
 Change: Sat Jul 23 13:26:27 2011
 
 fk@r500 ~/git/privoxy $stat -x ~/git/curl/..
   File: "/home/fk/git/curl/.."
   Size: 33           FileType: Directory
   Mode: (0755/drwxr-xr-x)         Uid: ( 1001/      fk)  Gid: ( 1001/      =
 fk)
 Device: 113,472580146   Inode: 3    Links: 33
 Access: Fri Mar 12 23:05:31 2010
 Modify: Sat Jul 23 13:26:27 2011
 Change: Sat Jul 23 13:26:27 2011
 
 fk@r500 ~/git/privoxy $stat -x ~/git/privoxy/..
 stat: /home/fk/git/privoxy/..: stat: Permission denied
 
 So somehow as a user I'm allowed to access "~/git" but not "~/git/privoxy/.=
 .".
 
 bash's builtin cd doesn't seem to use '..', so it continues to work.
 
 ~/git, ~/git/privoxy and ~/git/curl are different datasets.
 
 Scrubbing the pool doesn't show any issues.
 
 If I send/receive a snapshot of ~/git/privoxy, the copy doesn't
 have the problem.
 
 As far as I know, I only have the problem with "~/git/privoxy/..".
 The problem survived several ZFS updates so far, and at least in
 may case it's neither a regression in ZFSv28 nor serious.
 
 Fabian
 
 --Sig_/Dci3z9B3kZCsY_I=wEyT+/a
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Disposition: attachment; filename=signature.asc
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (FreeBSD)
 
 iEYEARECAAYFAk4qs+QACgkQBYqIVf93VJ0UvgCgrKRZDFGC+2/ieE7wBasQXg96
 QIAAn0uj2tj8BF+X9QpLBWSL8llfKd23
 =4CRh
 -----END PGP SIGNATURE-----
 
 --Sig_/Dci3z9B3kZCsY_I=wEyT+/a--

From: Gary Palmer <gpalmer@freebsd.org>
To: Michael Haro <mharo@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/159077: Can't cd .. with latest zfs version
Date: Mon, 25 Jul 2011 12:25:34 -0400

 On Wed, Jul 20, 2011 at 11:37:21PM -0700, Michael Haro wrote:
 > 
 > >Number:         159077
 > >Category:       kern
 > >Synopsis:       Can't cd .. with latest zfs version
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Thu Jul 21 07:10:07 UTC 2011
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Michael Haro
 > >Release:        FreeBSD 8.2-STABLE amd64
 > >Organization:
 > >Environment:
 > System: FreeBSD backups.mtv.bitsurf.net 8.2-STABLE FreeBSD 8.2-STABLE #1: Sat Jul 16 19:26:28 PDT 2011 root@backups.mtv.bitsurf.net:/usr/obj/usr/src/sys/KERNEL amd64
 > 
 > 
 > freebsd 8.2 stable as of july 16th
 > zpool version 28
 > zfs version 3
 > 
 > >Description:
 > 
 > trying to cd up one level using 'cd ..' gives permission denied
 > 	
 > >How-To-Repeat:
 > 
 > use sh or tcsh, not bash...
 > 
 > $ pwd
 > /home/mharo
 > $ cd ..
 > cd: can't cd to ..
 > $ ls -ald /home
 > drwxr-xr-x  4 root  wheel  4 Nov 29  2009 /home
 > $ ls -ald /home/mharo
 > drwxr-xr-x  3 mharo  users  15 Jul 20 22:49 /home/mharo
 > $ cd /home
 > $ pwd
 > /home
 > $ ls -ald mharo
 > drwxr-xr-x  3 mharo  users  15 Jul 20 22:49 mharo
 > $ cd mharo
 > $ cd ..
 > cd: can't cd to ..
 > 
 > so obviously I can cd into /home, just not via ..
 > 
 > $ zfs list -r zroot/home
 > NAME               USED  AVAIL  REFER  MOUNTPOINT
 > zroot/home         162K  2.70G    26K  /home
 > zroot/home/mharo   119K  2.70G  35.5K  /home/mharo
 
 It may be worth unmounting /home/mharo and checking the permissions
 of the directory underneath the mount point.  e.g.
 
 % mkdir /tmp/159077
 % chmod 0 /tmp/159077
 % ls -la /tmp/159077
 total 274
 d---------   2 root  wheel     512 Jul 25 17:22 .
 drwxrwxrwt  57 root  wheel  249344 Jul 25 17:22 ..
 % mount /dev/md0 /tmp/159077
 % ls -la /tmp/159077
 total 276
 drwxr-xr-x   3 root  wheel        512 Jul 25 17:21 .
 drwxrwxrwt  57 root  wheel     249344 Jul 25 17:22 ..
 drwxrwxr-x   2 root  operator     512 Jul 25 17:21 .snap
 %
 
 and then as a regular user:
 
 $ cd /tmp/159077/
 $ pwd
 /tmp/159077
 $ ls -la
 ls: ..: Permission denied
 total 4
 drwxr-xr-x  3 root  wheel     512 Jul 25 17:21 .
 drwxrwxr-x  2 root  operator  512 Jul 25 17:21 .snap
 $ ls -la ..
 ls: ..: Permission denied
 $ cd ..
 cd: can't cd to ..
 $ 
 
 Regards
 
 Gary
State-Changed-From-To: open->feedback 
State-Changed-By: araujo 
State-Changed-When: Wed May 2 17:35:52 UTC 2012 
State-Changed-Why:  
Do you still have this issue? THave you tried the solution mentioned by 
Gary Palmer? Shall we close this PR? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159077 
State-Changed-From-To: feedback->open 
State-Changed-By: araujo 
State-Changed-When: Wed May 2 17:42:44 UTC 2012 
State-Changed-Why:  
Keep the PR open!

http://www.freebsd.org/cgi/query-pr.cgi?pr=159077 
>Unformatted:
