Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2013 21:13:07 -0500 (EST)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Sergey Kandaurov <pluknet@gmail.com>, FreeBSD Current <freebsd-current@FreeBSD.org>
Subject:   Re: panic: LK_RETRY set with incompatible flags
Message-ID:  <1137922035.2777364.1360203187367.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <51127612.8000305@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Andriy Gapon wrote:
> on 06/02/2013 17:15 Rick Macklem said the following:
> > Well, zfs_vget() returns EOPNOTSUPP for .zfs, so the NFS server
> > knows to
> > switch over to using VOP_LOOKUP(). If the .zfs/snapshot and
> > .zfs/share
> > do the same thing, that should be fine, at least for the NFS server,
> > I think.
> 
> Ah, right, but again this is done only for .zfs and .zfs/snapshot.
> .zfs/shares is not special-cased and thus is problematic here too in
> the same
> fashion as zfs_fhtovp.
> 
Well, I have no way to test this, but maybe the attached patch is a
start in the right direction.

Maybe you can take a look at it and/or Sergey could test it?

Thanks for all your help with this, rick

> --
> Andriy Gapon

[-- Attachment #2 --]
--- cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c.sav	2013-02-06 19:38:41.000000000 -0500
+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	2013-02-06 20:06:38.000000000 -0500
@@ -2009,7 +2009,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla
 	 * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP.
 	 * This will make NFS to switch to LOOKUP instead of using VGET.
 	 */
-	if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR)
+	if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR ||
+	    ino == zfsvfs->z_shares_dir)
 		return (EOPNOTSUPP);
 
 	ZFS_ENTER(zfsvfs);
@@ -2099,14 +2100,22 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int
 		return (EINVAL);
 	}
 
-	/* A zero fid_gen means we are in the .zfs control directories */
-	if (fid_gen == 0 &&
-	    (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) {
+	/*
+	 * A zero fid_gen means we are in .zfs or the .zfs/snapshot
+	 * directory tree. If the object == zfsvfs->z_shares_dir, then
+	 * we are in the .zfs/shares directory tree.
+	 */
+	if ((fid_gen == 0 &&
+	     (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) ||
+	    object == zfsvfs->z_shares_dir) {
 		*vpp = zfsvfs->z_ctldir;
 		ASSERT(*vpp != NULL);
 		if (object == ZFSCTL_INO_SNAPDIR) {
 			VERIFY(zfsctl_root_lookup(*vpp, "snapshot", vpp, NULL,
 			    0, NULL, NULL, NULL, NULL, NULL) == 0);
+		} else if (object == zfsvfs->z_shares_dir) {
+			VERIFY(zfsctl_root_lookup(*vpp, "shares", vpp, NULL,
+			    0, NULL, NULL, NULL, NULL, NULL) == 0);
 		} else {
 			VN_HOLD(*vpp);
 		}

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1137922035.2777364.1360203187367.JavaMail.root>