From owner-freebsd-current@freebsd.org Fri Nov 6 21:15:23 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 477482D2A75; Fri, 6 Nov 2020 21:15:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 4CSY7s516yz4mt1; Fri, 6 Nov 2020 21:15:21 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x336.google.com with SMTP id h62so2581856wme.3; Fri, 06 Nov 2020 13:15:21 -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=dkhBgI6adDb2C1VNKTyr7skQkC756/3lJcyKhey9kWg=; b=gq8dNGFi+MVBxaJckM72Lsc924ZX7WFfnQCpwKyreWYTWxJoki02ZW8uZVw6NI8kUP ucr0mtkajY9Zdy/fcPRhIc4DKXRWoyP9RVDLYjse6EoEWAHg1EUfdT2KxvnNsm1DXMLk 08Y5P3ugjufN0IN8b2BDMwsx5UDwZ91GOX+3q0bEa8wq/R0D+vMMHAdvr/JGeh8Hkgb7 nmjp6dLVj/5aNsi0Qc//2oe3XIqVyClDIA9lReKgt5+PBcHVbkLQiri8L5Kqp4pt/E63 8XzRHW818ynRFJa7MppNRC+YDojHdGLF8xSm4EtnWm9NUjJxSQG4JzzCk+zS0gch1lV1 tNUQ== X-Gm-Message-State: AOAM533vdI/dJNemwo/7ppPhXJ4pb9yjyC/+giZaYyfM8+oq2LKG4yoH glyj+TWGG6smVLermWXtJBI5vSK8EksV/2aaZG7fGFTr X-Google-Smtp-Source: ABdhPJwZe7Q4tAuok3w2h5zSlJYzKXd+QOV2GQdmQVoAftaH02r5WrcBnnjBkM0GlVGBhYD1hu2I63XuQF1bMMRwrYo= X-Received: by 2002:a1c:2905:: with SMTP id p5mr1513709wmp.187.1604697319442; Fri, 06 Nov 2020 13:15:19 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:4c4f:0:0:0:0:0 with HTTP; Fri, 6 Nov 2020 13:15:18 -0800 (PST) In-Reply-To: References: <98c87b4f-4327-8a19-cf51-f3a14e42edf4@FreeBSD.org> From: Mateusz Guzik Date: Fri, 6 Nov 2020 22:15:18 +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: 4CSY7s516yz4mt1 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.98 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::336:from]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::336:from:127.0.2.255]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::336:from]; NEURAL_HAM_SHORT(-0.98)[-0.979]; 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: Fri, 06 Nov 2020 21:15:23 -0000 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