From: Akinobu Mita When we've allocated SWAPFILE_CLUSTER pages, ->cluster_next should be the first index of swap cluster. But current code probably sets it wrong offset. Signed-off-by: Akinobu Mita Acked-by: Hugh Dickins Signed-off-by: Andrew Morton --- mm/swapfile.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN mm/swapfile.c~fix-swap-cluster-offset mm/swapfile.c --- 25/mm/swapfile.c~fix-swap-cluster-offset Wed Mar 15 14:16:05 2006 +++ 25-akpm/mm/swapfile.c Wed Mar 15 14:16:05 2006 @@ -116,7 +116,7 @@ static inline unsigned long scan_swap_ma last_in_cluster = offset + SWAPFILE_CLUSTER; else if (offset == last_in_cluster) { spin_lock(&swap_lock); - si->cluster_next = offset-SWAPFILE_CLUSTER-1; + si->cluster_next = offset-SWAPFILE_CLUSTER+1; goto cluster; } if (unlikely(--latency_ration < 0)) { _