Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5629372pxv; Wed, 7 Jul 2021 08:09:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlTnql9QrYLBR8dhEIihrSB/G4pO3CCIR6IqGxnWvUXbl15Wnikf7M7UxVLNqoS+wX4CAW X-Received: by 2002:a17:907:97c7:: with SMTP id js7mr24411639ejc.59.1625670577896; Wed, 07 Jul 2021 08:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625670577; cv=none; d=google.com; s=arc-20160816; b=LqBlHJXgM7F1jCd0LupHXND8Pa7N3XS+DiW+mTV0IjarCwgDY9BulW8XcuxHxryo6X tgaILDp5TwG/rUKVhzhfVMBUc8J45MkRmoY8lE5YTreo2/RWdaOETqdwe4WMGpS9mz1w wLfMxj/b6boZ9H5k0zruM3rAIi/NwOBemmLwZJwl+Uk7uEyg0TY7orCbvGa5E99KBsgl tnrgcmXKbKL92umtsknjnrVdku5v7BoNXNJOmak0M7Ti0jtySDXd2BU6MWTan2ezIBc2 8OsecMXw6QwDU95fuUeIXvGh+qgweHHvC/N0E4uebc3oGoeyujPKa7MGKYM5szcWnoCt G2nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CaCSu/N+sBttIqY0NPzPYE8ZNOk6Z+4Yt0hcd+XhYqQ=; b=Iri2NTynGgBUB+XbuqDuaaXARelAarBZI/rOK00mu2UAu634976ucXrKPQrPV8Ckna zhYfYJzMqcnfcCo/ff0l07NyKXT1MBT4cugYmuPBGomMnBVY1FOAe6JxiZG2RTovMvNb J0lANznbYlKsL7W7ewhp2R5oclXZd32Meq5oBduUnLcyHiuxN0GIEfI9xDXtoL0f8syy CnI3O+lYwPnxNrHvPdTnuisqZxvw3gtZ5Q8Bb6EovOAvtNgml++xIycMqBo7mQJi6NjO qb6p9ubfe7pGqCMLTJORCRukxp+U9c/93qKnCVMNqK813mnaEzEt4Xsh7F9FbGygVexL d1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ifbyG30k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ee31si786595edb.352.2021.07.07.08.09.14; Wed, 07 Jul 2021 08:09:37 -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=@linuxfoundation.org header.s=korg header.b=ifbyG30k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232170AbhGGPJa (ORCPT + 99 others); Wed, 7 Jul 2021 11:09:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:36318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbhGGPJa (ORCPT ); Wed, 7 Jul 2021 11:09:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6909F61CC0; Wed, 7 Jul 2021 15:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625670409; bh=meAqswieIwvglWxHVG7o8tCUh+PaGXqIKM7610mdBRE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ifbyG30kR+elhqc/M7He0RvljFsanuwgzukhqgOpYhpFwIv6TlI3xLqSyR8zlzOhe ikdopdgkXRGXAyM6+aoYSirbsi5uysEeK53V+65DvNbMd+Zr181AfBVyMJ8F5IbL33 oWCITkCkZT4ZbHdhBbxw7htM3HIjzS9QJ8mtY7ow= Date: Wed, 7 Jul 2021 17:06:45 +0200 From: Greg KH To: "J. Bruce Fields" 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: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210707135129.GA9446@fieldses.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Don't be lazy, handle the error properly and report it upwards. thanks, greg k-h