diff options
author | davide <davide@FreeBSD.org> | 2012-11-14 18:43:58 +0000 |
---|---|---|
committer | davide <davide@FreeBSD.org> | 2012-11-14 18:43:58 +0000 |
commit | d7bac6192931bb9aacd3b09b871eeaa462809ff2 (patch) | |
tree | d251cfc3b461fdcfa0e18ab7707289a9a1fdfe0d /sys | |
parent | 18400f04ea3bc1ecc13a019b4197f5ae44f7cb27 (diff) | |
download | FreeBSD-src-d7bac6192931bb9aacd3b09b871eeaa462809ff2.zip FreeBSD-src-d7bac6192931bb9aacd3b09b871eeaa462809ff2.tar.gz |
Fix the lookup in the DOTDOT case in the same way as other filesystems do,
i.e. inlining the vn_vget_ino() algorithm.
Sponsored by: iXsystems inc.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/smbfs/smbfs_vnops.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index cc1e4d0..82dbee7 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -1278,9 +1278,30 @@ smbfs_lookup(ap) goto out; } if (flags & ISDOTDOT) { + mp = dvp->v_mount; + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + vfs_ref(mp); + VOP_UNLOCK(dvp, 0); + error = vfs_busy(mp, 0); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + vfs_rel(mp); + if (error) + return (ENOENT); + if ((dvp->v_iflag & VI_DOOMED) != 0) { + vfs_unbusy(mp); + return (ENOENT); + } + } VOP_UNLOCK(dvp, 0); error = smbfs_nget(mp, dvp, name, nmlen, NULL, &vp); + vfs_unbusy(mp); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + if ((dvp->v_iflag & VI_DOOMED) != 0) { + if (error == 0) + vput(vp); + error = ENOENT; + } if (error) goto out; *vpp = vp; |