Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29068
b: refs/heads/master
c: e0f2360
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 23, 2006
1 parent 0ffa95b commit d3604d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57ae2508610d50893cb3e3bbb869ff70ff724a2a
refs/heads/master: e0f23603fb2607315ce52432cc4225df410828cf
22 changes: 16 additions & 6 deletions trunk/mm/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,24 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
pgoff_t index;
int lock_failed;

if (TestSetPageLocked(page)) {
next++;
continue;
}
if (page->index > next)
next = page->index;
lock_failed = TestSetPageLocked(page);

/*
* We really shouldn't be looking at the ->index of an
* unlocked page. But we're not allowed to lock these
* pages. So we rely upon nobody altering the ->index
* of this (pinned-by-us) page.
*/
index = page->index;
if (index > next)
next = index;
next++;
if (lock_failed)
continue;

if (PageDirty(page) || PageWriteback(page))
goto unlock;
if (page_mapped(page))
Expand Down

0 comments on commit d3604d3

Please sign in to comment.