diff options
Diffstat (limited to 'mm/memory-failure.c')
| -rw-r--r-- | mm/memory-failure.c | 16 | 
1 files changed, 2 insertions, 14 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 6379fff1a5ff..7c72f2a95785 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -966,7 +966,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,  	enum ttu_flags ttu = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS;  	struct address_space *mapping;  	LIST_HEAD(tokill); -	bool unmap_success = true; +	bool unmap_success;  	int kill = 1, forcekill;  	struct page *hpage = *hpagep;  	bool mlocked = PageMlocked(hpage); @@ -1028,19 +1028,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,  	if (kill)  		collect_procs(hpage, &tokill, flags & MF_ACTION_REQUIRED); -	if (!PageHuge(hpage)) { -		unmap_success = try_to_unmap(hpage, ttu); -	} else if (mapping) { -		/* -		 * For hugetlb pages, try_to_unmap could potentially call -		 * huge_pmd_unshare.  Because of this, take semaphore in -		 * write mode here and set TTU_RMAP_LOCKED to indicate we -		 * have taken the lock at this higer level. -		 */ -		i_mmap_lock_write(mapping); -		unmap_success = try_to_unmap(hpage, ttu|TTU_RMAP_LOCKED); -		i_mmap_unlock_write(mapping); -	} +	unmap_success = try_to_unmap(hpage, ttu);  	if (!unmap_success)  		pr_err("Memory failure: %#lx: failed to unmap page (mapcount=%d)\n",  		       pfn, page_mapcount(hpage));  | 
