frontswap: enable call to invalidate area on swapoff
[firefly-linux-kernel-4.4.55.git] / mm / swapfile.c
index 64458e3997bcf4dd18b6255967827e28a7cfa3fd..612a7c9795f6eca1f43f7e86af43d2e74e2f56fa 100644 (file)
@@ -1924,10 +1924,10 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
        p->cluster_info = NULL;
        p->flags = 0;
        frontswap_map = frontswap_map_get(p);
-       frontswap_map_set(p, NULL);
        spin_unlock(&p->lock);
        spin_unlock(&swap_lock);
        frontswap_invalidate_area(type);
+       frontswap_map_set(p, NULL);
        mutex_unlock(&swapon_mutex);
        free_percpu(p->percpu_cluster);
        p->percpu_cluster = NULL;