* [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback()
@ 2025-12-02 18:27 Rafael J. Wysocki
2025-12-03 10:10 ` Christian Brauner
2025-12-03 10:28 ` Jan Kara
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-12-02 18:27 UTC (permalink / raw)
To: Christian Brauner
Cc: Alexander Viro, Jan Kara, Ard Biesheuvel, linux-fsdevel, LKML,
Linux PM
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The freeze_all_ptr check in filesystems_freeze_callback() introduced by
commit a3f8f8662771 ("power: always freeze efivarfs") is reverse which
quite confusingly causes all file systems to be frozen when
filesystem_freeze_enabled is false.
On my systems it causes the WARN_ON_ONCE() in __set_task_frozen() to
trigger, most likely due to an attempt to freeze a file system that is
not ready for that.
Add a logical negation to the check in question to reverse it as
appropriate.
Fixes: a3f8f8662771 ("power: always freeze efivarfs")
Cc: 6.18+ <stable@vger.kernel.org> # 6.18+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/super.c
+++ b/fs/super.c
@@ -1188,7 +1188,7 @@ static void filesystems_freeze_callback(
if (!sb->s_op->freeze_fs && !sb->s_op->freeze_super)
return;
- if (freeze_all_ptr && !(sb->s_type->fs_flags & FS_POWER_FREEZE))
+ if (!freeze_all_ptr && !(sb->s_type->fs_flags & FS_POWER_FREEZE))
return;
if (!get_active_super(sb))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback()
2025-12-02 18:27 [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback() Rafael J. Wysocki
@ 2025-12-03 10:10 ` Christian Brauner
2025-12-03 10:28 ` Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2025-12-03 10:10 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Christian Brauner, Alexander Viro, Jan Kara, linux-fsdevel, LKML,
Linux PM, Ard Biesheuvel
On Tue, 02 Dec 2025 19:27:29 +0100, Rafael J. Wysocki wrote:
> The freeze_all_ptr check in filesystems_freeze_callback() introduced by
> commit a3f8f8662771 ("power: always freeze efivarfs") is reverse which
> quite confusingly causes all file systems to be frozen when
> filesystem_freeze_enabled is false.
>
> On my systems it causes the WARN_ON_ONCE() in __set_task_frozen() to
> trigger, most likely due to an attempt to freeze a file system that is
> not ready for that.
>
> [...]
Ah, thanks for catching that.
---
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes 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.fixes
[1/1] fs: PM: Fix reverse check in filesystems_freeze_callback()
https://git.kernel.org/vfs/vfs/c/222047f68e85
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback()
2025-12-02 18:27 [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback() Rafael J. Wysocki
2025-12-03 10:10 ` Christian Brauner
@ 2025-12-03 10:28 ` Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2025-12-03 10:28 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Christian Brauner, Alexander Viro, Jan Kara, Ard Biesheuvel,
linux-fsdevel, LKML, Linux PM
On Tue 02-12-25 19:27:29, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The freeze_all_ptr check in filesystems_freeze_callback() introduced by
> commit a3f8f8662771 ("power: always freeze efivarfs") is reverse which
> quite confusingly causes all file systems to be frozen when
> filesystem_freeze_enabled is false.
>
> On my systems it causes the WARN_ON_ONCE() in __set_task_frozen() to
> trigger, most likely due to an attempt to freeze a file system that is
> not ready for that.
>
> Add a logical negation to the check in question to reverse it as
> appropriate.
>
> Fixes: a3f8f8662771 ("power: always freeze efivarfs")
> Cc: 6.18+ <stable@vger.kernel.org> # 6.18+
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -1188,7 +1188,7 @@ static void filesystems_freeze_callback(
> if (!sb->s_op->freeze_fs && !sb->s_op->freeze_super)
> return;
>
> - if (freeze_all_ptr && !(sb->s_type->fs_flags & FS_POWER_FREEZE))
> + if (!freeze_all_ptr && !(sb->s_type->fs_flags & FS_POWER_FREEZE))
> return;
>
> if (!get_active_super(sb))
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-03 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 18:27 [PATCH v1] fs: PM: Fix reverse check in filesystems_freeze_callback() Rafael J. Wysocki
2025-12-03 10:10 ` Christian Brauner
2025-12-03 10:28 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).