All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christine Caulfield <ccaulfie@redhat.com>,
	David Teigland <teigland@redhat.com>,
	Steve Whitehouse <swhiteho@redhat.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexios Zavras <alexios.zavras@intel.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Richard Fontana <rfontana@redhat.com>,
	cluster-devel@redhat.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dlm: remove BUG() before panic()
Date: Fri, 8 May 2020 11:11:02 -0700	[thread overview]
Message-ID: <CAKwvOdmk0bKNY735KNtB1agDgTwcLNM=DEU7pL3wwZTj7hQh2Q@mail.gmail.com> (raw)
In-Reply-To: <20200507213438.1886005-1-arnd@arndb.de>

On Thu, May 7, 2020 at 2:34 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> Building a kernel with clang sometimes fails with an objtool error in dlm:
>
> fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc
>
> The problem is that BUG() never returns and the compiler knows
> that anything after it is unreachable, however the panic still
> emits some code that does not get fully eliminated.
>
> Having both BUG() and panic() is really pointless as the BUG()
> kills the current process and the subsequent panic() never hits.
> In most cases, we probably don't really want either and should
> replace the DLM_ASSERT() statements with WARN_ON(), as has
> been done for some of them.
>
> Remove the BUG() here so the user at least sees the panic message
> and we can reliably build randconfig kernels.
>
> Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> Cc: clang-built-linux@googlegroups.com
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  fs/dlm/dlm_internal.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
> index 416d9de35679..4311d01b02a8 100644
> --- a/fs/dlm/dlm_internal.h
> +++ b/fs/dlm/dlm_internal.h
> @@ -97,7 +97,6 @@ do { \
>                 __LINE__, __FILE__, #x, jiffies); \
>      {do} \
>      printk("\n"); \
> -    BUG(); \
>      panic("DLM:  Record message above and reboot.\n"); \
>    } \
>  }
> --
> 2.26.0


-- 
Thanks,
~Nick Desaulniers

WARNING: multiple messages have this Message-ID (diff)
From: Nick Desaulniers <ndesaulniers@google.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] dlm: remove BUG() before panic()
Date: Fri, 8 May 2020 11:11:02 -0700	[thread overview]
Message-ID: <CAKwvOdmk0bKNY735KNtB1agDgTwcLNM=DEU7pL3wwZTj7hQh2Q@mail.gmail.com> (raw)
In-Reply-To: <20200507213438.1886005-1-arnd@arndb.de>

On Thu, May 7, 2020 at 2:34 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> Building a kernel with clang sometimes fails with an objtool error in dlm:
>
> fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc
>
> The problem is that BUG() never returns and the compiler knows
> that anything after it is unreachable, however the panic still
> emits some code that does not get fully eliminated.
>
> Having both BUG() and panic() is really pointless as the BUG()
> kills the current process and the subsequent panic() never hits.
> In most cases, we probably don't really want either and should
> replace the DLM_ASSERT() statements with WARN_ON(), as has
> been done for some of them.
>
> Remove the BUG() here so the user at least sees the panic message
> and we can reliably build randconfig kernels.
>
> Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> Cc: clang-built-linux at googlegroups.com
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  fs/dlm/dlm_internal.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
> index 416d9de35679..4311d01b02a8 100644
> --- a/fs/dlm/dlm_internal.h
> +++ b/fs/dlm/dlm_internal.h
> @@ -97,7 +97,6 @@ do { \
>                 __LINE__, __FILE__, #x, jiffies); \
>      {do} \
>      printk("\n"); \
> -    BUG(); \
>      panic("DLM:  Record message above and reboot.\n"); \
>    } \
>  }
> --
> 2.26.0


-- 
Thanks,
~Nick Desaulniers



  reply	other threads:[~2020-05-08 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 21:34 [PATCH] dlm: remove BUG() before panic() Arnd Bergmann
2020-05-07 21:34 ` [Cluster-devel] " Arnd Bergmann
2020-05-08 18:11 ` Nick Desaulniers [this message]
2020-05-08 18:11   ` Nick Desaulniers

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='CAKwvOdmk0bKNY735KNtB1agDgTwcLNM=DEU7pL3wwZTj7hQh2Q@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=alexios.zavras@intel.com \
    --cc=arnd@arndb.de \
    --cc=ccaulfie@redhat.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=cluster-devel@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rfontana@redhat.com \
    --cc=swhiteho@redhat.com \
    --cc=teigland@redhat.com \
    /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.