Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5651231pxv; Wed, 7 Jul 2021 08:38:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKd29pdbPqQZC7V50eS4TwL5dG1y326saKogjXHQBUMt3ta2VLtgqJaLtRw5BjH8uJICd1 X-Received: by 2002:aa7:c996:: with SMTP id c22mr30992150edt.374.1625672314170; Wed, 07 Jul 2021 08:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625672314; cv=none; d=google.com; s=arc-20160816; b=l4LI3MsHRP0ul06xIv5y8J+LOkNVi2SAW07N3+EM8IyFkil/bfmEwMh7sw3cn+AwTu 7O4OzYDigwkE+R3sPlwjBnC5Pfpnz8Vx04alFsX/SkyoLJ3wfLcNziR1tM5/vUrXvg4L Vbqr6175LXFzR+5+XgIiRj9zM6voBX3kcq2WDGhl5a3VnOmFRFm8f4quy3z4neE76eGn btmqDtyqpGeChLAQvFOotARrkPnS/MMy487a+jjsX8lzgO3JX2I7ZZg3xg9cn1ARp2U5 sfy+e6U9pqbuWIodCuUcKSz2xW+g+HNuUqjC9p9Tkd2CFNYBIKBNQhY2FHfYd1djQ0tx uTOQ== 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=kx7bZBkzdc+hE7A5f/06HWJB2o1Y2o6QSxXlXY94jc8=; b=ke2bNKWq7G804YTquwx1jRCKBEo6pmtv+g5wTKUBTbjjG/cE9eFEzWitu6PkysO6F1 GCjelwvAVBgMf4iVZ1oGm3/ilT3ROxPaH0M2AUAcobsBWx+bLFY87qg2BK+jFpKNd1Ob UsDh4Brr9DNlgyY5CQRZ6fxTLSgl0dSps96ErKy3aSh1Nae64mq9fUI2wberZeW0B4Zn m5Z9wV4s/1yC8xBs8EYo10b8uPxthO0MiXn3u7Mc9RajV/k0z+zn34meQDqa+QxUHyY2 M9FEWzYBUDPgB46U1+dKSnYx8Fq5PzJuHCdNhty/Q15CiwnrLsupgy1gC4aSxLl2Q//z zaZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=r8Ha6aZl; 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 q18si22769999edi.368.2021.07.07.08.38.11; Wed, 07 Jul 2021 08:38:34 -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=r8Ha6aZl; 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 S231771AbhGGPhA (ORCPT + 99 others); Wed, 7 Jul 2021 11:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbhGGPg7 (ORCPT ); Wed, 7 Jul 2021 11:36:59 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4567FC061574; Wed, 7 Jul 2021 08:34:19 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id DC693581C; Wed, 7 Jul 2021 11:34:17 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org DC693581C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1625672057; bh=kx7bZBkzdc+hE7A5f/06HWJB2o1Y2o6QSxXlXY94jc8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r8Ha6aZlcfCRLla7rg1zVPZk3LnoOmb6OxikkRdo83xo6Iurx9Yukwp9zAb52cy8F YaFmNlcZu3ogJ7TMPuIUkbxT8WMgihBfWjp4Of3UkQhnQzcvXA5MJ/pkU/emd+8eGA ErRgyF9U084fibaqcqWu9fxCa4zBWX9kLd5MCBxU= Date: Wed, 7 Jul 2021 11:34:17 -0400 From: "J. Bruce Fields" To: Greg KH Cc: Jeff Layton , 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: <20210707153417.GA10570@fieldses.org> References: <20210707023548.15872-1-desmondcheongzx@gmail.com> <20210707023548.15872-2-desmondcheongzx@gmail.com> <14633c3be87286d811263892375f2dfa9a8ed40a.camel@kernel.org> <4dda1cad6348fced5fcfcb6140186795ed07d948.camel@kernel.org> <20210707135129.GA9446@fieldses.org> <20210707151936.GB9911@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 05:31:06PM +0200, Greg KH wrote: > On Wed, Jul 07, 2021 at 11:19:36AM -0400, J. Bruce Fields wrote: > > On Wed, Jul 07, 2021 at 05:06:45PM +0200, Greg KH wrote: > > > On Wed, Jul 07, 2021 at 09:51:29AM -0400, J. Bruce Fields wrote: > > > > 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? > > > > > > You never use WARN or BUG, unless the system is so messed up that you > > > can not possibly recover from the issue. > > > > I've heard similar advice for BUG before, but this is the first I've > > heard it for WARN. Do we have any guidelines for how to choose between > > WARN and BUG? > > Never use either :) I can't tell if you're kidding. Is there some plan to remove them? There are definitely cases where I've been able to resolve a problem more quickly because I got a backtrace from a WARN. --b.