Skip to contentSkip to conversation

fs: PM: Fix reverse check in filesystems_freeze_callback()

PATCH Applied Rafael J. Wysocki 3 participants 3 messages Dec 2, 2025 – Dec 3, 2025 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: PM: Fix reverse check in filesystems_freeze_callback()

From: Rafael J. Wysocki <[email protected]>

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+ <[email protected]> # 6.18+
---
 fs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/super.c +1 -1
@@ -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))
maintainer Applied
#1 lore raw
Quoted 10 lines · Rafael J. Wysocki

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
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 11 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

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.

Quoted 6 lines

Add a logical negation to the check in question to reverse it as appropriate.

Fixes a3f8f8662771 ("power: always freeze efivarfs")
Cc 6.18+ <[email protected]> # 6.18+

Looks good. Feel free to add:

Honza

Quoted 18 lines
---
 fs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/super.c +1 -1
@@ -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))
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR