vfs: fix d_ancestor() case in d_materialize_unique
[firefly-linux-kernel-4.4.55.git] / fs / fscache / page.c
index 2f343b4d7a7d87b6792aad379b91ebffee9e15bc..3f7a59bfa7ada5cf1f8da1d7a391c36322004fba 100644 (file)
@@ -976,16 +976,12 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
 
        pagevec_init(&pvec, 0);
        next = 0;
-       while (next <= (loff_t)-1 &&
-              pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)
-              ) {
+       do {
+               if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE))
+                       break;
                for (i = 0; i < pagevec_count(&pvec); i++) {
                        struct page *page = pvec.pages[i];
-                       pgoff_t page_index = page->index;
-
-                       ASSERTCMP(page_index, >=, next);
-                       next = page_index + 1;
-
+                       next = page->index;
                        if (PageFsCache(page)) {
                                __fscache_wait_on_page_write(cookie, page);
                                __fscache_uncache_page(cookie, page);
@@ -993,7 +989,7 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
                }
                pagevec_release(&pvec);
                cond_resched();
-       }
+       } while (++next);
 
        _leave("");
 }