The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] reiserfs: avoid objtool warning after panic
@ 2022-12-15 16:27 Arnd Bergmann
  2022-12-15 22:31 ` kernel test robot
  2022-12-15 22:51 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-12-15 16:27 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: Arnd Bergmann, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-16  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15 16:27 [PATCH] reiserfs: avoid objtool warning after panic Arnd Bergmann
2022-12-15 22:31 ` kernel test robot
2022-12-16  8:00   ` Arnd Bergmann
2022-12-15 22:51 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox