All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: syzbot+e6d5398a02c516ce5e70@syzkaller.appspotmail.com,
	Jeff Layton <jlayton@kernel.org>,
	linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org,
	Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH v2 1/2] fcntl: fix potential deadlocks for &fown_struct.lock
Date: Wed, 7 Jul 2021 11:34:17 -0400	[thread overview]
Message-ID: <20210707153417.GA10570@fieldses.org> (raw)
In-Reply-To: <YOXIuhma++oMbbiH@kroah.com>

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.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

WARNING: multiple messages have this Message-ID (diff)
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Jeff Layton <jlayton@kernel.org>,
	Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>,
	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
Date: Wed, 7 Jul 2021 11:34:17 -0400	[thread overview]
Message-ID: <20210707153417.GA10570@fieldses.org> (raw)
In-Reply-To: <YOXIuhma++oMbbiH@kroah.com>

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.

  reply	other threads:[~2021-07-07 15:34 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  2:35 [PATCH v2 0/2] fcntl: fix potential deadlocks Desmond Cheong Zhi Xi
2021-07-07  2:35 ` Desmond Cheong Zhi Xi
2021-07-07  2:35 ` [PATCH v2 1/2] fcntl: fix potential deadlocks for &fown_struct.lock Desmond Cheong Zhi Xi
2021-07-07  2:35   ` Desmond Cheong Zhi Xi
2021-07-07  6:05   ` Greg KH
2021-07-07  6:05     ` Greg KH
2021-07-07  6:54     ` Desmond Cheong Zhi Xi
2021-07-07  6:54       ` Desmond Cheong Zhi Xi
2021-07-07 10:44     ` Jeff Layton
2021-07-07 10:44       ` Jeff Layton
2021-07-07 10:51       ` Greg KH
2021-07-07 10:51         ` Greg KH
2021-07-07 11:40         ` Jeff Layton
2021-07-07 11:40           ` Jeff Layton
2021-07-07 13:51           ` J. Bruce Fields
2021-07-07 13:51             ` J. Bruce Fields
2021-07-07 15:06             ` Greg KH
2021-07-07 15:06               ` Greg KH
2021-07-07 15:19               ` J. Bruce Fields
2021-07-07 15:19                 ` J. Bruce Fields
2021-07-07 15:31                 ` Greg KH
2021-07-07 15:31                   ` Greg KH
2021-07-07 15:34                   ` J. Bruce Fields [this message]
2021-07-07 15:34                     ` J. Bruce Fields
2021-07-07 15:46                     ` Greg KH
2021-07-07 15:46                       ` Greg KH
2021-07-07 16:18                       ` Jeff Layton
2021-07-07 16:18                         ` Jeff Layton
2021-07-07 16:25                         ` Matthew Wilcox
2021-07-07 16:25                           ` Matthew Wilcox
2021-07-07 17:52                           ` Jeff Layton
2021-07-07 17:52                             ` Jeff Layton
2021-07-07 17:58                           ` Eric Biggers
2021-07-07 17:58                             ` Eric Biggers
2021-07-07  2:35 ` [PATCH v2 2/2] fcntl: fix potential deadlock for &fasync_struct.fa_lock Desmond Cheong Zhi Xi
2021-07-07  2:35   ` Desmond Cheong Zhi Xi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707153417.GA10570@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=desmondcheongzx@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+e6d5398a02c516ce5e70@syzkaller.appspotmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.