Fix broken put_bh->brelse conversion
[ext4-patch-queue.git] / ext4_delalloc_setpageprivate_fix.patch
blob7274ebcc1a67dfad98fc8bab5b23a93dba4a06cd
1 ext4: delalloc setpageprivate fix (XXX fix comments, fold? in patch series?)
3 From: Mingming Cao <cmm@us.ibm.com>
5 On 16:46 Срд 20 Июн , Mingming Cao wrote:
6 > On Wed, 2007-06-20 at 12:15 +0400, Alex Tomas wrote:
7 > > Mingming Cao wrote:
8 > > > Hmm, PageMappedToDisk is probably not sufficient enough for pagesize!
9 > > > =blocksize. Is that the reason we need page->private to pass the
10 > > > request?
11 > >
12 > > PageMappedToDisk isn't enough in that case, definitely. bh is the way
13 > > to track state of each block (this is what i'm implementing now), but
14 > > I think current nobh version (per-page flags are used) is valuable.
15 > >
16 > > > That's good to know, thanks for the update. So probably above error case
17 > > > handling will be addressed in the new version?
18 > >
19 > > well, you actually can move that SetPagePrivate() few lines above
20 > > (Dmitriy already tested this).
22 > Like this?
23 Of course not, we may set page private bit only if
24 space was successfully reserved by ext4_wb_reserve_space_page().
25 So patch looks like this:
27 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
28 Signed-off-by: Alex Tomas <alex@clusterfs.com>
30 ---
31 fs/ext4/writeback.c | 6 +++---
32 1 file changed, 3 insertions(+), 3 deletions(-)
34 Index: linux-2.6.23-rc2/fs/ext4/writeback.c
35 ===================================================================
36 --- linux-2.6.23-rc2.orig/fs/ext4/writeback.c 2007-08-06 22:19:08.000000000 -0700
37 +++ linux-2.6.23-rc2/fs/ext4/writeback.c 2007-08-06 22:19:19.000000000 -0700
38 @@ -918,9 +918,6 @@ int ext4_wb_commit_write(struct file *fi
39 wb_debug("commit page %lu (%u-%u) for inode %lu\n",
40 page->index, from, to, inode->i_ino);
42 - /* mark page private so that we get
43 - * called to invalidate/release page */
44 - SetPagePrivate(page);
46 if (!PageBooked(page) && !PageMappedToDisk(page)) {
47 /* ->prepare_write() observed that block for this
48 @@ -932,6 +929,9 @@ int ext4_wb_commit_write(struct file *fi
49 if (err)
50 return err;
52 + /* mark page private so that we get
53 + * called to invalidate/release page */
54 + SetPagePrivate(page);
56 /* ok. block for this page is allocated already or it has
57 * been reserved succesfully. so, user may use it */