Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3715595rdb; Wed, 13 Sep 2023 23:39:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZ74RBnr62/LXkQqeqaXV+K5BfpSKAY9SZmqsnkkNwNkmYq4QsDFQJgYOP7EvWOmLfZ+ZK X-Received: by 2002:a05:6870:c6a5:b0:1be:ceca:c666 with SMTP id cv37-20020a056870c6a500b001bececac666mr5751561oab.14.1694673579133; Wed, 13 Sep 2023 23:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694673579; cv=none; d=google.com; s=arc-20160816; b=PMwJcImmiLNBZ+B+A70Hp4yfhoZdbWiGegzhbG1KJk7Izm2ksLl+MAjlpSdw9I7tDw cBOiY+X7COYRe4jABKz5LsVj++MDWcCCWMj2q5DGwe6cu5CE1Ka7H1ldynflqJ4gaudM e/EQsBM3xaBOkOeAyuDYdxDJOC+XbtmmXHuIZaiMO7GqRXgS9Tn75Q+3rtPgo7oa8Tnc tDipYkqxq62MtjlEDhXcFOrxphjJ4yZbS4KP+JUlXnMUJclqMXNB+oofUJePnVaNRtmC hiD5SH+4hOldr5wKejRtK2/TiyMcm+hjH+of5ea9TS3qP6ejM2CPyKy4mh3lCuYyT/pj abdQ== 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=BOhY4/HHjO8nyiv4RMgJQs8tmpa6Ek7TsfJHQTupOvg=; fh=8/oUzX0iC8yQPfNntb0eYWSKSldSlVaTv/n/37u/K2I=; b=nGSkTKQXmenzxbvHy9ECOSpTOy3J73H+Z0s6HIsQ+gS9CwdrXsm9C/IRyOTVxClJyT c/YdLfpEz0n+GtOTagniY3SVdddpUZ1Ub18nf15wiGOrbJHHMlavzqEo2FUQTcCECRdz DeOJ2fEmlrR0K8c6yk3EXO3VwOVUl0+eGW0zKCqUJkKvk0WdL6P9fwr01+oMlIKZUMSD 1qQCMsVrmnss8cuvJyijVGNfIenjfC1qGN5bQMuJzQ1AaNXHAKTlkm+OKxr0B8Fdl9mu LWAsShDwhTi2iStW5SVFBuF6wKORxhAbCSL0GfyE6bX/XXz31qRqbzqGGI7ztSfsMAzr TdzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jdFpariy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u64-20020a638543000000b0057764b2f3dfsi839267pgd.198.2023.09.13.23.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jdFpariy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 10F7D826EC08; Wed, 13 Sep 2023 18:01:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231935AbjINBBt (ORCPT + 99 others); Wed, 13 Sep 2023 21:01:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233190AbjINBBs (ORCPT ); Wed, 13 Sep 2023 21:01:48 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 838B01BCE for ; Wed, 13 Sep 2023 18:01:44 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso3009075ad.1 for ; Wed, 13 Sep 2023 18:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694653304; x=1695258104; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BOhY4/HHjO8nyiv4RMgJQs8tmpa6Ek7TsfJHQTupOvg=; b=jdFpariyWnhnu7oxSvA4Px+PFqgBiXE8sb08ZnJBmWI+W3q1tlTcIivzipR3ef64ms aj1b9S1oynR4ApuDESPrQAeSrOr5Sw7heOAKVKNoL17a7esqWBfVzWIFXOxXpzlekaRH 5pj3NQSHrLBs5lumLWoXy7sqXewPoQ1kzlM80= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694653304; x=1695258104; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BOhY4/HHjO8nyiv4RMgJQs8tmpa6Ek7TsfJHQTupOvg=; b=fHDTNongzljirZ8GsqYYNosKvGo+IhI5VzrZGnw/73IAaNCgQiXaX8KfKBBmX1rS7S 0IINwegKbPDahPAiqpDQ8zsfu+vfXhrVxcn7jSywf8KF9WRRpCu5CXBzyYybyQSSS5yi JUaVxkg4QT7Absg8+XpTsd16eyk5KzWH4TPulLhsENJowz0gt8na4OOG8RLWdlbqCcBy P2Oo/YEvK/72wGkF8hfMgZv+j2ghqWNShWMdk8DGZLo44jh1Qw+huvL3qMaAeoRmZplf TdOLCdgQpJWMqYPzc4U83Q6YN6NfPq+u7vNvbGHWn/GWWK6DOCtCS461qp/avyX6g+o6 D3Cw== X-Gm-Message-State: AOJu0YwTcXanzWBsdWm+RWcigvn1vY6F2uHDJ5jiwEfSvY0zwHruSk5K rUz8SUcq8IIJzGZDOXGaO3vE6Q== X-Received: by 2002:a17:902:ea01:b0:1c3:a1a8:969a with SMTP id s1-20020a170902ea0100b001c3a1a8969amr5151790plg.8.1694653303973; Wed, 13 Sep 2023 18:01:43 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id h7-20020a170902b94700b001bc21222e34sm216668pls.285.2023.09.13.18.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 18:01:43 -0700 (PDT) Date: Wed, 13 Sep 2023 18:01:42 -0700 From: Kees Cook To: Josh Poimboeuf Cc: Randy Dunlap , Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Kent Overstreet , Peter Zijlstra Subject: Re: linux-next: Tree for Sep 12 (bcachefs, objtool) Message-ID: <202309131758.208804F4@keescook> References: <20230912152645.0868a96a@canb.auug.org.au> <20230913210829.zkxv6qqlamymhatr@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913210829.zkxv6qqlamymhatr@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 18:01:52 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On Wed, Sep 13, 2023 at 11:08:29PM +0200, Josh Poimboeuf wrote: > On Tue, Sep 12, 2023 at 04:36:55PM -0700, Randy Dunlap wrote: > > > > > > On 9/11/23 22:26, Stephen Rothwell wrote: > > > Hi all, > > > > > > Changes since 20230911: > > > > > > New tree: bcachefs > > > > > > The bcachefs tree gained a semantic conflict against Linus' tree for > > > which I applied a patch. > > > > > > The wireless-next tree gaind a conflict against the wireless tree. > > > > > > Non-merge commits (relative to Linus' tree): 4095 > > > 1552 files changed, 346893 insertions(+), 22945 deletions(-) > > > > > > ---------------------------------------------------------------------------- > > > > on x86_64: > > > > vmlinux.o: warning: objtool: bch2_dev_buckets_reserved.part.0() is missing an ELF size annotation > > Here ya go: > > ---8<--- > > From: Josh Poimboeuf > Subject: [PATCH] bcachefs: Remove undefined behavior in bch2_dev_buckets_reserved() > > In general it's a good idea to avoid using bare unreachable() because it > introduces undefined behavior in compiled code. In this case it even > confuses GCC into emitting an empty unused > bch2_dev_buckets_reserved.part.0() function. > > Use BUG() instead, which is nice and defined. While in theory it should > never trigger, if something were to go awry and the BCH_WATERMARK_NR > case were to actually hit, the failure mode is much more robust. > > Fixes the following warnings: > > vmlinux.o: warning: objtool: bch2_bucket_alloc_trans() falls through to next function bch2_reset_alloc_cursors() > vmlinux.o: warning: objtool: bch2_dev_buckets_reserved.part.0() is missing an ELF size annotation > > Reported-by: Randy Dunlap > Signed-off-by: Josh Poimboeuf > --- > fs/bcachefs/buckets.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h > index f192809f50cf..0eff05c79c65 100644 > --- a/fs/bcachefs/buckets.h > +++ b/fs/bcachefs/buckets.h > @@ -180,7 +180,7 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum bch_waterma > > switch (watermark) { > case BCH_WATERMARK_NR: > - unreachable(); > + BUG(); Linus gets really upset about new BUG() usage (takes out the entire system): https://docs.kernel.org/process/deprecated.html#bug-and-bug-on It'd be nicer to actually handle the impossible case. (WARN and return 0?) -Kees > case BCH_WATERMARK_stripe: > reserved += ca->mi.nbuckets >> 6; > fallthrough; > -- > 2.41.0 > -- Kees Cook