From: Mingming Cao On 16:46 Срд 20 Июн , Mingming Cao wrote: > On Wed, 2007-06-20 at 12:15 +0400, Alex Tomas wrote: > > Mingming Cao wrote: > > > Hmm, PageMappedToDisk is probably not sufficient enough for pagesize! > > > =blocksize. Is that the reason we need page->private to pass the > > > request? > > > > PageMappedToDisk isn't enough in that case, definitely. bh is the way > > to track state of each block (this is what i'm implementing now), but > > I think current nobh version (per-page flags are used) is valuable. > > > > > That's good to know, thanks for the update. So probably above error case > > > handling will be addressed in the new version? > > > > well, you actually can move that SetPagePrivate() few lines above > > (Dmitriy already tested this). > > Like this? Of course not, we may set page private bit only if space was successfully reserved by ext4_wb_reserve_space_page(). So patch looks like this: Signed-off-by: Mingming Cao Signed-off-by: Alex Tomas --- fs/ext4/writeback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6.23-rc2/fs/ext4/writeback.c =================================================================== --- linux-2.6.23-rc2.orig/fs/ext4/writeback.c 2007-08-06 22:19:08.000000000 -0700 +++ linux-2.6.23-rc2/fs/ext4/writeback.c 2007-08-06 22:19:19.000000000 -0700 @@ -918,9 +918,6 @@ int ext4_wb_commit_write(struct file *fi wb_debug("commit page %lu (%u-%u) for inode %lu\n", page->index, from, to, inode->i_ino); - /* mark page private so that we get - * called to invalidate/release page */ - SetPagePrivate(page); if (!PageBooked(page) && !PageMappedToDisk(page)) { /* ->prepare_write() observed that block for this @@ -932,6 +929,9 @@ int ext4_wb_commit_write(struct file *fi if (err) return err; } + /* mark page private so that we get + * called to invalidate/release page */ + SetPagePrivate(page); /* ok. block for this page is allocated already or it has * been reserved succesfully. so, user may use it */