Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69605
b: refs/heads/master
c: 45726cb
h: refs/heads/master
i:
  69603: 29243e7
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Oct 16, 2007
1 parent 0636402 commit 80e8fb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: 001281881067a5998384c6669bc8dbbbab8456c4
refs/heads/master: 45726cb43d11b288c58243a26010f397054222f0
9 changes: 5 additions & 4 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,26 +621,27 @@ struct page *find_lock_page(struct address_space *mapping,
{
struct page *page;

read_lock_irq(&mapping->tree_lock);
repeat:
read_lock_irq(&mapping->tree_lock);
page = radix_tree_lookup(&mapping->page_tree, offset);
if (page) {
page_cache_get(page);
if (TestSetPageLocked(page)) {
read_unlock_irq(&mapping->tree_lock);
__lock_page(page);
read_lock_irq(&mapping->tree_lock);

/* Has the page been truncated while we slept? */
if (unlikely(page->mapping != mapping ||
page->index != offset)) {
if (unlikely(page->mapping != mapping)) {
unlock_page(page);
page_cache_release(page);
goto repeat;
}
VM_BUG_ON(page->index != offset);
goto out;
}
}
read_unlock_irq(&mapping->tree_lock);
out:
return page;
}
EXPORT_SYMBOL(find_lock_page);
Expand Down

0 comments on commit 80e8fb3

Please sign in to comment.