Subject: [PATCH -mm] /proc/swaps negative Used
From: Hugh Dickins <[email-masked]>
To: Andrew Morton <[email-masked]>
Date: Tue, 8 Feb 2005 16:39:36 +0000 (GMT)

Your swapspace-layout-improvements.patch inadvertently deletes
a line too many, so /proc/swaps tends to show negative Used.

I was tempted to delete "akpm", but compassion stayed my hand.

Sorry, I'm sure you'd appreciate proper feedback on the patch,
but I haven't studied it or noticed its impact yet.

Signed-off-by: Hugh Dickins <[email-masked]>

--- 2.6.11-rc3-mm1/mm/swapfile.c	2005-02-05 07:09:40.000000000 +0000
+++ linux/mm/swapfile.c	2005-02-08 16:29:30.000000000 +0000
@@ -119,6 +119,7 @@ scan_swap_map(struct swap_info_struct *s
 		if (si->swap_map[block])
 			continue;
 		si->swap_map[block] = 1;
+		si->inuse_pages++;
 		nr_swap_pages--;
 		if (akpm)
 			printk("cookie:%p, index:%lu, chunk:%lu nchunks:%lu "