diff options
author | pjd <pjd@FreeBSD.org> | 2009-09-26 00:07:14 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-09-26 00:07:14 +0000 |
commit | 0ea59187ebb27b2e5ece45d212af633e8133df78 (patch) | |
tree | 044deb88baae2b1f2531889422683afba5f60089 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c | |
parent | 5776e7865f19d4641dd56200f4e20c3082567226 (diff) | |
download | FreeBSD-src-0ea59187ebb27b2e5ece45d212af633e8133df78.zip FreeBSD-src-0ea59187ebb27b2e5ece45d212af633e8133df78.tar.gz |
Use traverse() function to find and return mount point's vnode instead of
covered vnode when snapshot is already mounted.
MFC after: 3 days
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c index 0b034f6..cdc3774 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -818,7 +818,11 @@ zfsctl_snapdir_lookup(ap) if ((sep = avl_find(&sdp->sd_snaps, &search, &where)) != NULL) { *vpp = sep->se_root; VN_HOLD(*vpp); - if ((*vpp)->v_mountedhere == NULL) { + err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY); + if (err) { + VN_RELE(*vpp); + *vpp = NULL; + } else if (*vpp == sep->se_root) { /* * The snapshot was unmounted behind our backs, * try to remount it. @@ -832,10 +836,9 @@ zfsctl_snapdir_lookup(ap) */ (*vpp)->v_flag &= ~VROOT; } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); - return (0); + return (err); } /* |