diff --git a/mm/fremap.c b/mm/fremap.c
index e10dcea97913737d1152a7e172432516495d78d7..f5c8b64ffb711fa17b75bd0dd111b92b62d79902 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -61,12 +61,6 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	pmd_t *pmd;
 	pte_t pte_val;
 
-	/*
-	 * We use page_add_file_rmap below: if install_page is
-	 * ever extended to anonymous pages, this will warn us.
-	 */
-	BUG_ON(!page_mapping(page));
-
 	pgd = pgd_offset(mm, addr);
 	spin_lock(&mm->page_table_lock);
 
@@ -78,6 +72,14 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	if (!pte)
 		goto err_unlock;
 
+	/*
+	 * This page may have been truncated. Tell the
+	 * caller about it.
+	 */
+	err = -EAGAIN;
+	if (!page_mapping(page))
+		goto err_unlock;
+
 	zap_pte(mm, vma, addr, pte);
 
 	mm->rss++;