GFS2: Fix cache coherency between truncate and O_DIRECT read
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>
This commit is contained in:
parent
f6d03139d7
commit
40bc9a27e0
|
@ -1012,7 +1012,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
|
||||||
gfs2_trans_add_bh(ip->i_gl, bh, 0);
|
gfs2_trans_add_bh(ip->i_gl, bh, 0);
|
||||||
|
|
||||||
zero_user(page, offset, length);
|
zero_user(page, offset, length);
|
||||||
|
mark_buffer_dirty(bh);
|
||||||
unlock:
|
unlock:
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
page_cache_release(page);
|
page_cache_release(page);
|
||||||
|
|
Loading…
Reference in New Issue