From patchwork Thu Dec 15 16:27:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 33716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp470258wrn; Thu, 15 Dec 2022 08:44:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf52v1DMPyAt83CnwXb/vqI9OmrhPS0CfJjfZhEYf5JXl99VIe7jvj1nAjRjdmRjIVJmsTm+ X-Received: by 2002:a05:6a20:bca9:b0:ac:ab16:442 with SMTP id fx41-20020a056a20bca900b000acab160442mr32127379pzb.4.1671122654239; Thu, 15 Dec 2022 08:44:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671122654; cv=none; d=google.com; s=arc-20160816; b=uPYzpnbIvalWFwIYBIErz8uQZ4A1AZSNmTWtMtLJKaMuUJPIcRQqH6GK2MoRyKJM+U w7PSTjyWhQxVUlzSKku2d3/BtEjcjXS7PEMQYZgaZC6DFOvVTSLbQfl3Vxjanxzoba/v KR64/yUwM2ncDoA23IeOpTjSe2Gz0ZZmEYRztwohUQp2gtZcuxZODXIO0OUyedVZx8r+ gpHsZxwH0+Ay+0Np2gEULKXGMqfa3roMcitdS2cRjTznTiwRSmBorqQq7xhgqQzyZicD S/ojZ6PaBbZj47ypf1lqdSdRYv/oKIjRRiZDkSHiPFXAndPPbsCj+OFTwxYzft30mLmX PTGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=R1HQd6O6YnY4sNAbRwA/AJ6Fzkyi+iIRl+tcmTb7vy8=; b=elK7JWAtEbta0Yi9Rm+SVZx88ZdnCDPw/Wq8BRp1tn9KsF0FMYt//NPAWqHKXzvlge ms/wWG2k0LWmGEflfPfujMifOD+HVNOh/F7CuN9flHvTqRPBunSZDoBgmIpsHl/6QqLD YnEQpVkTH4PcbPLTf0Tpv3bzv5EPBjRzMxIxEM4bQhAJZ5M8LNcOqVjwiq4Xgf/tiiEz ezkmVFxYB03Q6SHgm6/exCtydZm4jev9IQbNd0u+DeNLNGhXTZeKh8vOTx8UKwVf1ZcN aFl6lTiPjatENgLHaJEG3H8uphGhtQ1vJYRI41UvFjc5+r0LJEXzhXyXrHVHaPF0NI1T 1VeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0XBV1r0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a63cd02000000b004784f928f15si3334354pgg.91.2022.12.15.08.44.01; Thu, 15 Dec 2022 08:44:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0XBV1r0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbiLOQ3A (ORCPT + 99 others); Thu, 15 Dec 2022 11:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbiLOQ2R (ORCPT ); Thu, 15 Dec 2022 11:28:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A4313D2D; Thu, 15 Dec 2022 08:28:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0DA6A61E58; Thu, 15 Dec 2022 16:28:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9524AC433D2; Thu, 15 Dec 2022 16:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671121688; bh=Ftx0VJqQ/+fSyw2rH/KASxALEE3T+b2McIeIvddmZzA=; h=From:To:Cc:Subject:Date:From; b=e0XBV1r0zWcJu0n2d4qSajU11xPT3DE71JiEWFEu4b/m4lw3lld4W/tWSp7TgqTx0 EKHDZ4+qVSIVTVW+CSt5NXSK75KIuRoHK84h+EARII30o2IpXn4OC4OV+vNPEfNP/j F5QWLQcwyymCwiPIoonCw5ZWUUiiiLPeiXeMpG9yYXbK9JWLtKfGnVk6LE2BLVIDSZ rY82j+5PzzxWt7YR2dICth28bJXNhtsyO7DIo1BfGZStwWH2WZnVabADCwyiqRDx1Q vpG2w9ZRlj2BiS+Z+kVGvM7f2pG0sXtF/G/hc2PLj5JGavJy7juUTNEypuIxXnND7M nCsEA3U2/B7pw== From: Arnd Bergmann To: reiserfs-devel@vger.kernel.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] reiserfs: avoid objtool warning after panic Date: Thu, 15 Dec 2022 17:27:53 +0100 Message-Id: <20221215162759.3883282-1-arnd@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752299108137516438?= X-GMAIL-MSGID: =?utf-8?q?1752299108137516438?= From: Arnd Bergmann Calling reiserfs_panic() leaves the calling function in an undefined state that objtool complains about, because of the __noreturn attribute: fs/reiserfs/do_balan.o: warning: objtool: balance_leaf+0x109fb: stack state mismatch: cfa1=4+576 cfa2=4+584 fs/reiserfs/ibalance.o: warning: objtool: balance_internal+0x6099: stack state mismatch: cfa1=4+512 cfa2=4+536 fs/reiserfs/ibalance.o: warning: objtool: internal_insert_key+0xa1c: stack state mismatch: cfa1=4+224 cfa2=4+216 Avoid that by removing the attribute, at the possible cost of a few extra cycles. Mark the panic and error functions as __cold instead to at least give the compiler a hint that this is not the fast path. Signed-off-by: Arnd Bergmann --- fs/reiserfs/reiserfs.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 3aa928ec527a..1c22f48235c2 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -3185,12 +3185,11 @@ int fix_nodes(int n_op_mode, struct tree_balance *tb, void unfix_nodes(struct tree_balance *); /* prints.c */ -void __reiserfs_panic(struct super_block *s, const char *id, - const char *function, const char *fmt, ...) - __attribute__ ((noreturn)); +void __cold __reiserfs_panic(struct super_block *s, const char *id, + const char *function, const char *fmt, ...); #define reiserfs_panic(s, id, fmt, args...) \ __reiserfs_panic(s, id, __func__, fmt, ##args) -void __reiserfs_error(struct super_block *s, const char *id, +void __cold __reiserfs_error(struct super_block *s, const char *id, const char *function, const char *fmt, ...); #define reiserfs_error(s, id, fmt, args...) \ __reiserfs_error(s, id, __func__, fmt, ##args)