]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
GFS2: Fix cache coherency between truncate and O_DIRECT read
authorSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Jun 2009 08:09:40 +0000 (09:09 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Jun 2009 08:09:40 +0000 (09:09 +0100)
If a page was partially zeroed as the result of a truncate, then it was
not being correctly marked dirty. This resulted in the deleted data
reappearing if the file was read back via direct I/O.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/bmap.c

index 1153a078920c2b2d29372166518b57aebf7a53cc..329763530dc065847057b5be1c81b408763b46dd 100644 (file)
@@ -1012,7 +1012,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
                gfs2_trans_add_bh(ip->i_gl, bh, 0);
 
        zero_user(page, offset, length);
-
+       mark_buffer_dirty(bh);
 unlock:
        unlock_page(page);
        page_cache_release(page);