Author: avg
Date: Mon May 29 06:30:34 2017
New Revision: 319096
URL: https://svnweb.freebsd.org/changeset/base/319096

Log:
  zfs_lookup: fix bogus arguments to lookup of "snapshot" directory
  
  When a parent directory lookup is done at the root of a snapshot mounted
  under .zfs/snapshot directory, we need to look up that directory in
  the parent filesystem.  We achieve that by doing a VOP_LOOKUP operation
  on a .zfs vnode with "snapshot" as a target name.  But previously we
  also passed ISDOTDOT flag to the lookup and, because of that, the lookup
  actually returned the parent of the .zfs vnode, that is, a root vnode of
  the parent filesystem.
  
  Reported by:  lev
  Tested by:    lev
  MFC after:    3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c     Mon May 
29 06:26:00 2017        (r319095)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c     Mon May 
29 06:30:34 2017        (r319096)
@@ -1635,7 +1635,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
                                cn.cn_nameptr = "snapshot";
                                cn.cn_namelen = strlen(cn.cn_nameptr);
                                cn.cn_nameiop = cnp->cn_nameiop;
-                               cn.cn_flags = cnp->cn_flags;
+                               cn.cn_flags = cnp->cn_flags & ~ISDOTDOT;
                                cn.cn_lkflags = cnp->cn_lkflags;
                                error = VOP_LOOKUP(zfsctl_vp, vpp, &cn);
                                vput(zfsctl_vp);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to