From: Hugh Dickins <hugh@veritas.com>
Fix a screwup in the merging of swap extents: not only do they have to be
contiguous on-disk, they have to be logically contiguous in file offset too.
lh = sis->extent_list.next; /* The highest-addressed block */
while (lh != &sis->extent_list) {
se = list_entry(lh, struct swap_extent, list);
- if (se->start_block + se->nr_pages == start_block) {
+ if (se->start_block + se->nr_pages == start_block &&
+ se->start_page + se->nr_pages == start_page) {
/* Merge it */
se->nr_pages += nr_pages;
return 0;