|
@@ -355,14 +355,16 @@ void truncate_inode_pages_range(struct address_space *mapping,
|
|
|
for ( ; ; ) {
|
|
|
cond_resched();
|
|
|
if (!pagevec_lookup_entries(&pvec, mapping, index,
|
|
|
- min(end - index, (pgoff_t)PAGEVEC_SIZE),
|
|
|
- indices)) {
|
|
|
+ min(end - index, (pgoff_t)PAGEVEC_SIZE), indices)) {
|
|
|
+ /* If all gone from start onwards, we're done */
|
|
|
if (index == start)
|
|
|
break;
|
|
|
+ /* Otherwise restart to make sure all gone */
|
|
|
index = start;
|
|
|
continue;
|
|
|
}
|
|
|
if (index == start && indices[0] >= end) {
|
|
|
+ /* All gone out of hole to be punched, we're done */
|
|
|
pagevec_remove_exceptionals(&pvec);
|
|
|
pagevec_release(&pvec);
|
|
|
break;
|
|
@@ -373,8 +375,11 @@ void truncate_inode_pages_range(struct address_space *mapping,
|
|
|
|
|
|
/* We rely upon deletion not changing page->index */
|
|
|
index = indices[i];
|
|
|
- if (index >= end)
|
|
|
+ if (index >= end) {
|
|
|
+ /* Restart punch to make sure all gone */
|
|
|
+ index = start - 1;
|
|
|
break;
|
|
|
+ }
|
|
|
|
|
|
if (radix_tree_exceptional_entry(page)) {
|
|
|
clear_exceptional_entry(mapping, index, page);
|