lkml.org 
[lkml]   [1996]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectserious bug in filemap.c
Date
Hello!

It is possible (and occurs!) that not uptodate pages are mapped into
process space.
Maybe, this fix is not complete.

BTW, someone complained about NFS mmap oddities. Maybe, this fix will
repair them too.

/*
* Find a cached page and wait for it to become up-to-date, return
^ comment is ok. But code does
not it!
* the page address. Increments the page count.
*/
static inline unsigned long fill_page(struct inode * inode, unsigned long offset)
{
...........
add_to_page_cache(page, inode, offset);
inode->i_op->readpage(inode, page);
#ifdef NO_ANK_FIX
if (PageLocked(page))
new_page = try_to_read_ahead(inode, offset + PAGE_SIZE, 0);
#else
if (PageUptodate(page) || PageLocked(page))
new_page = try_to_read_ahead(inode, offset + PAGE_SIZE, 0);
#endif
found_page:
if (new_page)
free_page(new_page);
found_page_dont_free:
wait_on_page(page);
#ifndef NO_ANK_FIX
if (!PageUptodate(page)) {
inode->i_op->readpage(inode, page);
wait_on_page(page);
if (!PageUptodate(page)) {
if (PageError(page))
return 0;
goto found_page_dont_free;
}
}
#endif
return page_address(page);
}


Alexey Kuznetsov.


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.055 / U:4.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site