]> Git Repo - linux.git/commitdiff
mm/swap: don't BUG_ON() due to uninitialized swap slot cache
authorLinus Torvalds <[email protected]>
Mon, 20 Mar 2017 02:00:47 +0000 (19:00 -0700)
committerLinus Torvalds <[email protected]>
Mon, 20 Mar 2017 02:00:47 +0000 (19:00 -0700)
This BUG_ON() triggered for me once at shutdown, and I don't see a
reason for the check.  The code correctly checks whether the swap slot
cache is usable or not, so an uninitialized swap slot cache is not
actually problematic afaik.

I've temporarily just switched the BUG_ON() to a WARN_ON_ONCE(), since
I'm not sure why that seemingly pointless check was there.  I suspect
the real fix is to just remove it entirely, but for now we'll warn about
it but not bring the machine down.

Cc: "Huang, Ying" <[email protected]>
Cc: Tim Chen <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/swap_slots.c

index 9b5bc86f96ad731269e2051719583f168a74bc51..7ebb23836f689e766caa71bd775c0b919f658bb9 100644 (file)
@@ -267,7 +267,7 @@ int free_swap_slot(swp_entry_t entry)
 {
        struct swap_slots_cache *cache;
 
-       BUG_ON(!swap_slot_cache_initialized);
+       WARN_ON_ONCE(!swap_slot_cache_initialized);
 
        cache = &get_cpu_var(swp_slots);
        if (use_swap_slot_cache && cache->slots_ret) {
This page took 0.055866 seconds and 4 git commands to generate.