Skip to content

Commit d2d7b8a

Browse files
committed
[GFS2] Fix bug in writepage()
As pointed out by Wendy Cheng, the logic in GFS2's writepage() function wasn't quite right with respect to invalidating pages when a file has been truncated. This patch fixes that. CC: Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 56409ab commit d2d7b8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/gfs2/ops_address.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
126126

127127
/* Is the page fully outside i_size? (truncate in progress) */
128128
offset = i_size & (PAGE_CACHE_SIZE-1);
129-
if (page->index >= end_index+1 || !offset) {
129+
if (page->index > end_index || (page->index == end_index && !offset)) {
130130
page->mapping->a_ops->invalidatepage(page, 0);
131131
unlock_page(page);
132132
return 0; /* don't care */

0 commit comments

Comments
 (0)