From owner-freebsd-current@freebsd.org Mon Nov 9 11:28:18 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DBC62EF290; Mon, 9 Nov 2020 11:28:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CV7z54w5Tz4g52; Mon, 9 Nov 2020 11:28:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from [192.168.0.88] (east.meadow.volia.net [93.72.151.96]) (Authenticated sender: andriy.gapon@uabsd.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B9DDE100019; Mon, 9 Nov 2020 11:28:14 +0000 (UTC) Subject: Re: panic: VERIFY(ZFS_TEARDOWN_READ_HELD(zfsvfs)) failed To: Mateusz Guzik Cc: freebsd-current@freebsd.org, freebsd-fs@freebsd.org References: <98c87b4f-4327-8a19-cf51-f3a14e42edf4@FreeBSD.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; keydata= mDMEX1iFDhYJKwYBBAHaRw8BAQdAiu8JG/oLFkVkOAJqJc7Dx5KI/Q6C3SBI20EQm+DXnAu0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEEyCHHZM09l0OE3Ir/ 1A1+Gq8+L1EFAl9YhQ4CGwMFCQeEzgAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ1A1+ Gq8+L1Fc0wD/ZjmhHfbCJywZU3aOxXIPjcz73FYEGMvqMCCLAWyLbSABALFL+1ZNrjV3BGjq 889cOYFuboA/Yn3eWezS+tfqYBsGuDgEX1iFDhIKKwYBBAGXVQEFAQEHQL6B20Xi600TrkpG P9fWjl7JtHNxqrHKhX6Kg7kgb4ILAwEIB4h+BBgWCAAmFiEEyCHHZM09l0OE3Ir/1A1+Gq8+ L1EFAl9YhQ4CGwwFCQeEzgAACgkQ1A1+Gq8+L1F3cgEAktp4h+IJUJxL1vn6zMOt//znni/J TanKfQuA8wGXcGkBAKpZJhqMkg+pKk7MGvJhgJ6nCpTZ+rMK6vZVZLUWc3QF Message-ID: <5850cf84-4004-3782-45cb-bf4ed6d71b1b@FreeBSD.org> Date: Mon, 9 Nov 2020 13:28:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CV7z54w5Tz4g52 X-Spamd-Bar: / X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR]; local_wl_from(0.00)[FreeBSD.org] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 11:28:18 -0000 On 07/11/2020 19:00, Mateusz Guzik wrote: > Fixed as of r367454 (also see r367453). Thank you! > On 11/6/20, Mateusz Guzik wrote: >> I think I have an idea how to keep this. In the meantime you can just >> comment it out. >> >> On 11/6/20, Mateusz Guzik wrote: >>> On 11/6/20, Andriy Gapon wrote: >>>> On 06/11/2020 22:58, Mateusz Guzik wrote: >>>>> Note the underlying primitive was recently replaced. >>>>> >>>>> One immediate thing to check would be exact state of the lock. >>>>> READ_HELD checks for reading only, fails if you have this >>>>> write-locked, which is a plausible explanation if you are coming in >>>>> from less likely codepath. >>>>> >>>>> iow what's the backtrace and can you print both rms->readers and >>>>> rms->owner (+ curthread) >>>> >>>> Unfortunately, I do not have a vmcore, only a picture of the screen. >>>> >>>> ZFS code looks correct, the lock should be held in read mode, so indeed >>>> I >>>> suspect that the problem is with rms. >>>> >>>> It looks like rms_rlock() does not change rmslock::readers, but >>>> rms_rowned() >>>> checks it? >>>> >>>> That's just from a first, super-quick look at the code. >>>> >>> >>> Heh, now that you mention it, I remember wanting to just remove the >>> arguably spurious assert. Linux is never doing it for reading. The >>> only state asserts made are for writing which works fine. >>> >>> As for reading assertions, there is no performant way to make it work >>> and I don't think it is worth it as it is. >>> >>> As such, I vote for just removing these 2 asserts. They really don't >>> buy anything to begin with. >>> >>> -- >>> Mateusz Guzik >>> >> >> >> -- >> Mateusz Guzik >> > > -- Andriy Gapon