Date: Sat, 12 Sep 2009 19:30:08 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-fs@FreeBSD.org Subject: Re: kern/132068: commit references a PR Message-ID: <200909121930.n8CJU8oJ059918@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/132068; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/132068: commit references a PR Date: Sat, 12 Sep 2009 19:28:07 +0000 (UTC) Author: pjd Date: Sat Sep 12 19:27:54 2009 New Revision: 197131 URL: http://svn.freebsd.org/changeset/base/197131 Log: 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 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Sep 12 19:07:03 2009 (r197130) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Sep 12 19:27:54 2009 (r197131) @@ -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); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909121930.n8CJU8oJ059918>