Date: Thu, 12 Sep 2002 22:45:28 -0700 (PDT) From: Don Lewis <dl-freebsd@catspoiler.org> To: iedowse@maths.tcd.ie Cc: tlambert2@mindspring.com, current@FreeBSD.ORG, jeff@FreeBSD.ORG Subject: Re: nfs_inactive() bug? -> panic: lockmgr: locking against myself Message-ID: <200209130545.g8D5jSwr002343@gw.catspoiler.org> In-Reply-To: <200209130245.aa42965@salmon.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
On 13 Sep, Ian Dowse wrote: > For example, if you hold the reference count at 1 while calling the > cleanup function, it allows that function to safely add and drop > references, but if that cleanup function has a bug that drops one > too many references then you end up recursing instead of detecting > it as a negative reference count. I've found in some other code > that it works reasonably well to leave the reference count at zero, > but set a flag to stop further 1->0 transitions from retriggering > the cleanup. Obviously other approaches will work too. The cleanup function shouldn't be mucking with the reference count, which means that the present implementation of nfs_inactive() is broken, but I think there is already general agreement on that point. The only possible exception would be to increase the reference count to pass a reference to another thread, but that would be a silly thing for a cleanup function to do, since it would no longer be cleaning up. We could add a flag that would cause an immediate panic if the cleanup function fiddled with the reference count as an aid to tracking down broken code ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209130545.g8D5jSwr002343>