Skip to content

Commit

Permalink
GFS2: Fix cache coherency between truncate and O_DIRECT read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
swhiteho committed Jun 10, 2009
1 parent f6d0313 commit 40bc9a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 40bc9a2

Please sign in to comment.