* [PATCH] super: fix dying superblock warning messages
@ 2026-08-08 12:38 Karl Mehltretter
2026-08-12 7:20 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-08-08 12:38 UTC (permalink / raw)
To: Christian Brauner, Alexander Viro
Cc: Karl Mehltretter, Jan Kara, linux-fsdevel, linux-kernel, llvm
WARN_ON_ONCE() takes a condition, not a message. The string literals
are always true, so the warnings still trigger but the messages are
never printed.
Use WARN_ONCE(1, ...) instead to print the messages and keep the
once-only behavior.
Found with a Coccinelle script. Clang's -Wstring-conversion also flags
such calls but is not enabled in kernel builds.
Fixes: f0cd988016f6 ("fs: massage locking helpers")
Assisted-by: Claude:claude-fable-5 coccinelle
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
fs/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index a8fd61136aaf..56efcf1c31da 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -2012,7 +2012,7 @@ int freeze_super(struct super_block *sb, enum freeze_holder who, const void *fre
int ret;
if (!super_lock_excl(sb)) {
- WARN_ON_ONCE("Dying superblock while freezing!");
+ WARN_ONCE(1, "Dying superblock while freezing!");
return -EINVAL;
}
atomic_inc(&sb->s_active);
@@ -2176,7 +2176,7 @@ int thaw_super(struct super_block *sb, enum freeze_holder who,
const void *freeze_owner)
{
if (!super_lock_excl(sb)) {
- WARN_ON_ONCE("Dying superblock while thawing!");
+ WARN_ONCE(1, "Dying superblock while thawing!");
return -EINVAL;
}
return thaw_super_locked(sb, who, freeze_owner);
--
2.39.5 (Apple Git-154)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] super: fix dying superblock warning messages
2026-08-08 12:38 [PATCH] super: fix dying superblock warning messages Karl Mehltretter
@ 2026-08-12 7:20 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-08-12 7:20 UTC (permalink / raw)
To: Alexander Viro, Karl Mehltretter
Cc: Jan Kara, linux-fsdevel, linux-kernel, llvm
On Sat, 08 Aug 2026 14:38:02 +0200, Karl Mehltretter wrote:
> super: fix dying superblock warning messages
Applied to the vfs-7.3.super branch of the vfs/vfs.git tree.
Patches in the vfs-7.3.super branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.3.super
[1/1] super: fix dying superblock warning messages
https://git.kernel.org/vfs/vfs/c/9ac8fd831252
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-12 7:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-08 12:38 [PATCH] super: fix dying superblock warning messages Karl Mehltretter
2026-08-12 7:20 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®