Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5646044pxv; Wed, 7 Jul 2021 08:31:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmWx1RWE2Z9waIpgOClMwGXqT/n3wsDznBlhzIPpTwkmIf1j+9J0Bn8C7er7T4DNTx0wad X-Received: by 2002:a5d:8b03:: with SMTP id k3mr20172190ion.203.1625671905564; Wed, 07 Jul 2021 08:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625671905; cv=none; d=google.com; s=arc-20160816; b=pmk++UwI7qTGWs4Evr4RgiTuuqINi7MYFIGOElprR9qA30ndgF0MaDakdAlPfjX0rW oTLeh19WYW835b8pLKANOPkbaURJTiHzhXJUDAcSOOqZYElgi6PzoguQtqFUWhj0y/zH 3vFrgHpCmEFgivbO6tkTy9JyywJvZufqffY/Tfn+fiCuad2REUUY9kCepqzmve9cOTsa HTuEGYqllzudo3TRKtiI1yfzZqk4k0WZaGaCc5motohtra+gMMRwmaTb2cuWIC2irmIQ 7TLOPpyNI8TQSbSRnT+lk6Kd19YQnmGVBzYVD7binJ1aEzcjky/Q7jTyjxTuZsr1cQZ3 g7Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=gPeRkpFOKLgol1iXgNjO2sQ0E29J+JaZmTVNPoXkTRg=; b=mYsYsIz5Wp4ex6smD5imiT6dFXJDCDuIg+vOlOm4pBQXxOxlDzeiObk+d6MYqvit4K hGYtDknGOBIBZptFJOdP922eskW6JbCq4SbXq27PxHVHmc4KJGhQVLDB2AYWeC+Hn7s1 yVFTICO40C8CCdQk6gbxUWRXD3tRtJkrmZd3b0v4zuR8tFCrrPQTYVAND3719D6nRIVy W4uxUZaPYYQY/ZBrvn+ANL7sAiGAUU6NnzyxTNPyrouDs9cwrxf094jy6l4IsLw0nsza +P+oH3US00WBApK6/csBEuxblLFOkMXtTCzSa+IrRkTYqqvxFuGMOjfiF70sHxiuSkai /vLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=jod3VyGB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si3832637jal.77.2021.07.07.08.31.29; Wed, 07 Jul 2021 08:31:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=jod3VyGB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231829AbhGGNyL (ORCPT + 99 others); Wed, 7 Jul 2021 09:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbhGGNyL (ORCPT ); Wed, 7 Jul 2021 09:54:11 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D4B9C061574; Wed, 7 Jul 2021 06:51:30 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id B9C216830; Wed, 7 Jul 2021 09:51:29 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org B9C216830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1625665889; bh=gPeRkpFOKLgol1iXgNjO2sQ0E29J+JaZmTVNPoXkTRg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jod3VyGB4DhCJ+ICEBNzHaBiknO3C7zMEnZQxrc/ZyshSnI1azu8Jh3xQnRFlipuj eR+qgYiI0+vGTgH8Xb8eLUH4XMWmI/sN5jqPPlWTVKuDy5O0oOHIgQ8MD1naUe/Bes pbR2I2qCyVrFFtcEFK4qe4dIzAbxSHnGFEFhyTJw= Date: Wed, 7 Jul 2021 09:51:29 -0400 From: "J. Bruce Fields" To: Jeff Layton Cc: Greg KH , Desmond Cheong Zhi Xi , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, syzbot+e6d5398a02c516ce5e70@syzkaller.appspotmail.com Subject: Re: [PATCH v2 1/2] fcntl: fix potential deadlocks for &fown_struct.lock Message-ID: <20210707135129.GA9446@fieldses.org> References: <20210707023548.15872-1-desmondcheongzx@gmail.com> <20210707023548.15872-2-desmondcheongzx@gmail.com> <14633c3be87286d811263892375f2dfa9a8ed40a.camel@kernel.org> <4dda1cad6348fced5fcfcb6140186795ed07d948.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4dda1cad6348fced5fcfcb6140186795ed07d948.camel@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 07, 2021 at 07:40:47AM -0400, Jeff Layton wrote: > On Wed, 2021-07-07 at 12:51 +0200, Greg KH wrote: > > On Wed, Jul 07, 2021 at 06:44:42AM -0400, Jeff Layton wrote: > > > On Wed, 2021-07-07 at 08:05 +0200, Greg KH wrote: > > > > On Wed, Jul 07, 2021 at 10:35:47AM +0800, Desmond Cheong Zhi Xi wrote: > > > > > + WARN_ON_ONCE(irqs_disabled()); > > > > > > > > If this triggers, you just rebooted the box :( > > > > > > > > Please never do this, either properly handle the problem and return an > > > > error, or do not check for this. It is not any type of "fix" at all, > > > > and at most, a debugging aid while you work on the root problem. > > > > > > > > thanks, > > > > > > > > greg k-h > > > > > > Wait, what? Why would testing for irqs being disabled and throwing a > > > WARN_ON in that case crash the box? > > > > If panic-on-warn is enabled, which is a common setting for systems these > > days. > > Ok, that makes some sense. Wait, I don't get it. How are we supposed to decide when to use WARN, when to use BUG, and when to panic? Do we really want to treat them all as equivalent? And who exactly is turning on panic-on-warn? --b.