From owner-freebsd-current@freebsd.org Sat Nov 7 17:00:27 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 9CB55465027; Sat, 7 Nov 2020 17:00:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CT3RG6LJzz3KMF; Sat, 7 Nov 2020 17:00:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x436.google.com with SMTP id w1so4468397wrm.4; Sat, 07 Nov 2020 09:00:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=j94Z2WncivOYEB60+IjGTLpITzaBpljvKt5Evd96BwA=; b=k9Oh4CByPuc9bYdPbhus8pSxezEoWWtm6vcD/7o8zyUZvOUUq1OQoqsqVtiPzJu2s1 uX1h0F2nPx07LczIboAcWrYR1+NtPmMH/G8WF97uUNMW3HaeLsrit1AhUAo46IaPP8EK 8mzq/RtqwlFjDEgKaf8cGedjOIIhGGllvc/ttI3JbUuXFew8P+lf7tXUSt/wnhVGrmsE cto519nqNPLDSja9tuLwrkfa34gdzlPh5Jf6nMfxhYxW5ip+m0kzFwvr48SVZT0GM1GU BzpJgNX0Hh6/AMKFXE3qhDqHFs9SVqBaaKKeyh2N/bAjPf/wFE3+m5h3B3Jm2rDg+Bdy u32w== X-Gm-Message-State: AOAM530MGiey5xys799N3+64unkmYkzPH1KxN+xoZlk4szlsizdA7ykt ueZqSDJukes8fKsg3xSPdt1z9LDAXlUv0KmAYEwwt36J X-Google-Smtp-Source: ABdhPJyzzXgdMSgml25BgyJ1WI63lNSTHJXEY56d/snj+2aLdXdJWciqfz7Fl45C2DAk1e6k+R36xegc0ukuZ+Tdjbs= X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr8808581wrt.109.1604768424978; Sat, 07 Nov 2020 09:00:24 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:4c4f:0:0:0:0:0 with HTTP; Sat, 7 Nov 2020 09:00:24 -0800 (PST) In-Reply-To: References: <98c87b4f-4327-8a19-cf51-f3a14e42edf4@FreeBSD.org> From: Mateusz Guzik Date: Sat, 7 Nov 2020 18:00:24 +0100 Message-ID: Subject: Re: panic: VERIFY(ZFS_TEARDOWN_READ_HELD(zfsvfs)) failed To: Andriy Gapon Cc: freebsd-current@freebsd.org, freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CT3RG6LJzz3KMF X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.79 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::436:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::436:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::436:from]; NEURAL_HAM_SHORT(-0.79)[-0.785]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current,freebsd-fs]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] 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: Sat, 07 Nov 2020 17:00:27 -0000 Fixed as of r367454 (also see r367453). 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 > -- Mateusz Guzik