Sergey Kandaurov wrote: > Sergey Kandaurov wrote: > > On 7 February 2013 19:42, Andriy Gapon <a...@freebsd.org> wrote: > > > on 07/02/2013 17:36 Sergey Kandaurov said the following: > > >> I tested the patch without the (*vpp != dvp) change. > > >> It works well. > > >> > > >> It's something unrelated but when doing ls -l > > >> on server (patched) and client (unpatched) sides, > > >> I found some inconsistency in returned stats. > > >> Or more precisely: > > >> > > >> NFS server > > >> # stat -s /pool1/user1000/.zfs/shares/.. > > >> st_dev=2050684725 st_ino=1 st_mode=040555 st_nlink=4 st_uid=0 > > >> st_gid=0 > > >> st_rdev=0 st_size=4 st_atime=1360251211 st_mtime=1359551493 > > >> st_ctime=1359551493 st_birthtime=1359551493 st_blksize=4096 > > >> st_blocks=0 st_flags=0 > > >> > > >> NFS client > > >> # stat -s /home/user1000/.zfs/shares/.. > > >> st_dev=2050684725 st_ino=7 st_mode=040555 st_nlink=2 st_uid=0 > > >> st_gid=0 > > >> st_rdev=1377468712 st_size=2 st_atime=1360251104 > > >> st_mtime=1359551493 > > >> st_ctime=1359551493 st_birthtime=-1 st_blksize=4096 st_blocks=3 > > >> st_flags=0 > > > > > > Hmm, this looks more consistent with the earlier patch. > > > Are you sure that you really tested the new kernel (on the > > > server)? > > > > Sorry, I indeed booted a wrong kernel. > > Now tested the really new kernel :) And it works as well. > > stat -s looks consistent, thanks. > > > > # stat -s /home/user1000/.zfs/shares/.. > > st_dev=2050684725 st_ino=1 st_mode=040555 st_nlink=4 st_uid=0 > > st_gid=0 > > st_rdev=0 st_size=4 st_atime=1360252962 st_mtime=1359551493 > > st_ctime=1359551493 st_birthtime=-1 st_blksize=4096 st_blocks=0 > > st_flags=0 > > > Sounds good. I've attached a slightly updated patch with Andriy's > suggested addition of a check for zfsvfs->z_shares_dir != 0. > > I can't do any commits until April, so if one of you guys is > comfortable > enough with the patch to commit it, you are more than welcome to do > so. > > Thanks everyone for your help in resolving this, rick > I did my usual brain fart and forgot to attach the updated patch.
Here it is..rick > > -- > > wbr, > > pluknet > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to > > "freebsd-current-unsubscr...@freebsd.org" > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscr...@freebsd.org"
--- 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-07 10:25:04.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 || + (zfsvfs->z_shares_dir != 0 && 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)) || + (zfsvfs->z_shares_dir != 0 && 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); }
_______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"