--- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -973,7 +973,7 @@ start_over: goto nextsi; } if (cluster) { - if (!(si->flags & SWP_FILE)) + if (si->flags & SWP_BLKDEV) n_ret = swap_alloc_cluster(si, swp_entries); } else n_ret = scan_swap_map_slots(si, SWAP_HAS_CACHE,