diff --git a/mm/page_io.c b/mm/page_io.c index ac81f79de940b1c886829658ec15b2122b41f49d..97aaf9bb6a9e61cb6781338489eb53fc33577c15 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -76,6 +76,7 @@ static void swap_slot_free_notify(struct page *page) { struct swap_info_struct *sis; struct gendisk *disk; + swp_entry_t entry; /* * There is no guarantee that the page is in swap cache - the software @@ -107,11 +108,11 @@ static void swap_slot_free_notify(struct page *page) * we again wish to reclaim it. */ disk = sis->bdev->bd_disk; - if (disk->fops->swap_slot_free_notify) { - swp_entry_t entry; + entry.val = page_private(page); + if (disk->fops->swap_slot_free_notify && + __swap_count(entry) == 1) { unsigned long offset; - entry.val = page_private(page); offset = swp_offset(entry); SetPageDirty(page);