From owner-svn-src-all@freebsd.org Tue Apr 24 23:22:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 333D2FB6A33; Tue, 24 Apr 2018 23:22:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE8F477644; Tue, 24 Apr 2018 23:22:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x242.google.com with SMTP id o64so21122126qkl.7; Tue, 24 Apr 2018 16:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VUWSEcjsZ+5lQGnbzYwpTuma7cZVLlMWiJ41GZCkxZo=; b=M60KhuZLUeOEc6ZaKKEM78i0jmuZcEpThqzBs3AVtLg82MnOxN3YEMojfHGxfr1xDP 85visAYzLFXkHkUDSdLgKAJ8O+u+VZCxuaYiocQ00Wea0WV/u1soUmA4BvV7oFP1TJ98 VBexDdvMJdDkcvmii5keAMcbOgm15E3lg2RAbWsWzPDmnc5FV7hoy2nyWktM8EPVqys1 29VeODcMOGAan8g3BahOaoFVKJYjhpuhzRNeXoe2Y+KymH8BZd57yMVGp2Hm8Ax3guxw dTyIDuqWDezhKFk6di/9Er0B7uoo7x6G7iSBaH3bLr+6HwTBXEBJgGAkSS2SbYOciOXJ Femw== 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=VUWSEcjsZ+5lQGnbzYwpTuma7cZVLlMWiJ41GZCkxZo=; b=Zy8mjBMwCtBNRYCIOGbpVXbYNVYfMfU0vUywEO5rfd4ebfk5+xWpxtEbLiHma/uKP8 aS0vUpzoFDKfbGFV9mSnawBRQXq8VkYkb/IlppMpmw9wSe1S2kG8dlcolNqSLJfzyAHf 5VuJeCXVJ3UlS0zMe9DahaukxpcW9noXiz6mTEZPh6YddE1WjF5vVlk+Zz3yXmNwV8K+ ypV9RhAP80guRK8aFPpCjLh12aKbqO5MkV/x0+8iTHZ2bOs9KimI2cj8WYyXHu9DOWws JIBTXbci1lUQi+XqMiUQAh2cv9tY8UZZSVsMOXsUtuozSterkXlokf91xQtnalsnBS+8 GnyQ== X-Gm-Message-State: ALQs6tBLJM2ngsv3GoSWa++0kTa31TdMOfFBtg77Z4ncZXEJqk75r2DN yocbnOrTTlSxbDy6D7eWG1YYR1GBBBKzYtj6YZ8= X-Google-Smtp-Source: AB8JxZrUwGKr6qDsnmhElA2EZVUYYGfHL4yc9XRriEMtw3vPlfX04YgL0MUjecSFob71cywjTXmo2wG3ESPrZQ+MNiI= X-Received: by 10.233.224.8 with SMTP id m8mr5349161qkk.73.1524612154203; Tue, 24 Apr 2018 16:22:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Tue, 24 Apr 2018 16:22:33 -0700 (PDT) In-Reply-To: <201804241841.w3OIfE0U074131@repo.freebsd.org> References: <201804241841.w3OIfE0U074131@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 25 Apr 2018 01:22:33 +0200 Message-ID: Subject: Re: svn commit: r332957 - head/sys/kern To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:22:35 -0000 On Tue, Apr 24, 2018 at 8:41 PM, Conrad Meyer wrote: > Author: cem > Date: Tue Apr 24 18:41:14 2018 > New Revision: 332957 > URL: https://svnweb.freebsd.org/changeset/base/332957 > > Log: > lockmgr: Add missed neutering during panic > > r313683 introduced new lockmgr APIs that missed the panic-time neutering > present in the rest of our locks. Correct that by adding the usual > check. > > Additionally, move the __lockmgr_args neutering above the assertions at > the > top of the function. Drop the interlock unlock because we shouldn't have > an unneutered interlock either. No point trying to unlock it. > > PR: 227749 > Reported by: jtl > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/kern/kern_lock.c > > Modified: head/sys/kern/kern_lock.c > ============================================================ > ================== > --- head/sys/kern/kern_lock.c Tue Apr 24 18:19:30 2018 (r332956) > +++ head/sys/kern/kern_lock.c Tue Apr 24 18:41:14 2018 (r332957) > @@ -918,6 +918,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s > u_int op; > bool locked; > > + if (__predict_false(panicstr != NULL)) > + return (0); > + > > This only further pollutes the slowpath. I mean fastpath. All the fallback funcs check for panic, so there is no need to do it in regular kernels at this level. Instead, the firing assertion should also see if perhaps the kernel already has panicked. Alternatively, the checks added here can be conditional on INVARIANTS. -- Mateusz Guzik