diff options
author | pjd <pjd@FreeBSD.org> | 2009-09-12 19:27:54 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-09-12 19:27:54 +0000 |
commit | e70bbf0bf3d2ce850e791953345f5f966f4a5c08 (patch) | |
tree | a9c51d7f46e7b862f3a244ff5fd3637cdf634981 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c | |
parent | fe0bf7a268cb431078b5f1229e6f296482793184 (diff) | |
download | FreeBSD-src-e70bbf0bf3d2ce850e791953345f5f966f4a5c08.zip FreeBSD-src-e70bbf0bf3d2ce850e791953345f5f966f4a5c08.tar.gz |
Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
NULL, but also can point to dead vnode, take that into account.
PR: kern/132068
Reported by: Edward Fisk" <7ogcg7g02@sneakemail.com>, kris
Fix based on patch from: Jaakko Heinonen <jh@saunalahti.fi>
MFC after: 1 week
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index a6172f8..f90b413 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -890,8 +890,16 @@ again: if (zp->z_unlinked) { err = ENOENT; } else { - if (ZTOV(zp) != NULL) - VN_HOLD(ZTOV(zp)); + if ((vp = ZTOV(zp)) != NULL) { + VI_LOCK(vp); + if ((vp->v_iflag & VI_DOOMED) != 0) { + VI_UNLOCK(vp); + vp = NULL; + } else + VI_UNLOCK(vp); + } + if (vp != NULL) + VN_HOLD(vp); else { if (first) { ZFS_LOG(1, "dying znode detected (zp=%p)", zp); |