Date: Tue, 17 Sep 2002 03:31:05 -0700 (PDT) From: Don Lewis <dl-freebsd@catspoiler.org> To: arch@FreeBSD.org Cc: Ian Dowse <iedowse@maths.tcd.ie>, Terry Lambert <tlambert2@mindspring.com> Subject: VOP_INACTIVE() Message-ID: <200209171031.g8HAV5wr015790@gw.catspoiler.org>
next in thread | raw e-mail | index | archive | help
VOP_INACTIVE() is currently called by vput() and vrele() after the vnode reference count has been decremented to zero. This is messy because VOP_INACTIVE() may hang onto a reference to the vnode for an extended period of time while it does cleaup I/O. Judging by the comments in vget() and vclean(), this architectural oddity appears to have adverse consequences in other parts of the code. To work around some of the brokenness, nfs_inactive() temporary bumps the reference count, but unfortunately it calls vrele() recursively to decrement the reference count which results in a panic. A few different fixes have been proposed. The first fix is to set a flag on the vnode to indicate that VOP_INACTIVE() is playing with the vnode, so the vnode should not be reused even though its reference count is zero. The second fix is to all VOP_INACTIVE() before the reference count is decremented. The main problem with this is that some of the things done in the various filesystem inactive methods may depend strongly on the reference count being zero. One example is the call to vrecycle() in ufs_inactive(). A third fix would be to split VOP_INACTIVE() into two parts, one which is called to do any I/O before the reference count is decremented, and the other which does any filesystem specific cleanup after the reference count is decremented. Opinions? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209171031.g8HAV5wr015790>