update to rc6, and verified pass fsx/dbench
[ext4-patch-queue.git] / ext4_delalloc_setpageprivate_fix.patch
blob17bf38a46a274341dc918191225bc46edcc83f47
1 On 16:46 Срд 20 Июн , Mingming Cao wrote:
2 > On Wed, 2007-06-20 at 12:15 +0400, Alex Tomas wrote:
3 > > Mingming Cao wrote:
4 > > > Hmm, PageMappedToDisk is probably not sufficient enough for pagesize!
5 > > > =blocksize. Is that the reason we need page->private to pass the
6 > > > request?
7 > >
8 > > PageMappedToDisk isn't enough in that case, definitely. bh is the way
9 > > to track state of each block (this is what i'm implementing now), but
10 > > I think current nobh version (per-page flags are used) is valuable.
11 > >
12 > > > That's good to know, thanks for the update. So probably above error case
13 > > > handling will be addressed in the new version?
14 > >
15 > > well, you actually can move that SetPagePrivate() few lines above
16 > > (Dmitriy already tested this).
18 > Like this?
19 Of course not, we may set page private bit only if
20 space was successfully reserved by ext4_wb_reserve_space_page().
21 So patch looks like this:
23 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
25 diff --git a/fs/ext4/writeback.c b/fs/ext4/writeback.c
26 index 3e669d6..84e5029 100644
27 --- a/fs/ext4/writeback.c
28 +++ b/fs/ext4/writeback.c
29 @@ -904,9 +904,6 @@ int ext4_wb_commit_write(struct file *file, struct page *page,
30 wb_debug("commit page %lu (%u-%u) for inode %lu\n",
31 page->index, from, to, inode->i_ino);
33 - /* mark page private so that we get
34 - * called to invalidate/release page */
35 - SetPagePrivate(page);
37 if (!PageBooked(page) && !PageMappedToDisk(page)) {
38 /* ->prepare_write() observed that block for this
39 @@ -918,6 +915,9 @@ int ext4_wb_commit_write(struct file *file, struct page *page,
40 if (err)
41 return err;
43 + /* mark page private so that we get
44 + * called to invalidate/release page */
45 + SetPagePrivate(page);
47 /* ok. block for this page is allocated already or it has
48 * been reserved succesfully. so, user may use it */