lkml.org 
[lkml]   [2001]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] filemap_fdatasync & related changes
Ok, lets just fix filemap_fdatasync.  We can tackle the msync/fsync
interaction with screwed up FS writepages later, since all of the existing
writepage funcs are safe. The problems I see with filemap_fdatasync when
writepage returns 1:

The page dirty bit is not reset.
the page is never unlocked.

So how about something like this in filemap_fdatasync

ret = writepage(page) ;
if (ret == 1) {
/* writepage declined to write it out,
** leave it on the locked list, but make
** sure the dirty bit stays on so the page
** doesn't disappear
*/
SetPageDirty(page) ;
UnlockPage(page) ;
}

And then, in filemap_fdatawait:

list_del(&page->list) ;
if (PageDirty(page))
list_add(&page->list, &mapping->dirty_pages) ;
else
list_add(&page->list, &mapping->clean_pages) ;

-chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.076 / U:3.220 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site