aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/truncate.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index 7d20ce41ecf5..b8961cb63414 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -391,6 +391,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
391 pgoff_t next; 391 pgoff_t next;
392 int i; 392 int i;
393 int ret = 0; 393 int ret = 0;
394 int ret2 = 0;
394 int did_range_unmap = 0; 395 int did_range_unmap = 0;
395 int wrapped = 0; 396 int wrapped = 0;
396 397
@@ -438,9 +439,13 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
438 } 439 }
439 } 440 }
440 BUG_ON(page_mapped(page)); 441 BUG_ON(page_mapped(page));
441 ret = do_launder_page(mapping, page); 442 ret2 = do_launder_page(mapping, page);
442 if (ret == 0 && !invalidate_complete_page2(mapping, page)) 443 if (ret2 == 0) {
443 ret = -EIO; 444 if (!invalidate_complete_page2(mapping, page))
445 ret2 = -EIO;
446 }
447 if (ret2 < 0)
448 ret = ret2;
444 unlock_page(page); 449 unlock_page(page);
445 } 450 }
446 pagevec_release(&pvec); 451 pagevec_release(&pvec);