Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Aug 2019 13:50:44 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: userret: assert td_lk_slocks == 0
Message-ID:  <20190812105044.GB2738@kib.kiev.ua>
In-Reply-To: <94110a73-3c55-e87e-96ae-475014e45596@FreeBSD.org>
References:  <94110a73-3c55-e87e-96ae-475014e45596@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 12, 2019 at 12:14:25PM +0300, Andriy Gapon wrote:
> 
> I am trying to debug a leak of a shared vnode lock and I noticed that
> there is no check for td_lk_slocks in userret.  There are checks for
> td_rw_rlocks and td_sx_slocks.  I wonder if there is any valid scenario
> where a thread is allowed to retain a shared lock manager lock across
> system calls.

There is a situation where thread returns while keeping the lockmgr lock
busied.  This is used by buffer cache to keep everybody hands away of
async buffers until io is finished.  But the ownership of the lock is
erased, and the thread's slocks count is decremented.

I think it should be correct to add the assert you proposed.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190812105044.GB2738>