Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-02-12 23:47:03 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-12 23:47:03 -0800
commitfe252bd747123a3b91d406b700144fe8ae3c787d (patch)
treec8622ff486dd120ad86ec00f9c790d57a0c0d8d2
parent9ae91ee6b582b448d6cb7c93793c763e98b731d8 (diff)
[PATCH] swap extent merging fix
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.
-rw-r--r--mm/swapfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 112117a5d66c..ddf9b9d3fd00 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -841,7 +841,8 @@ add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
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;