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>
This commit is contained in:
Steven Whitehouse 2006-05-02 12:09:42 -04:00
Родитель 56409abbf8
Коммит d2d7b8a2a7
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -126,7 +126,7 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
/* Is the page fully outside i_size? (truncate in progress) */ /* Is the page fully outside i_size? (truncate in progress) */
offset = i_size & (PAGE_CACHE_SIZE-1); offset = i_size & (PAGE_CACHE_SIZE-1);
if (page->index >= end_index+1 || !offset) { if (page->index > end_index || (page->index == end_index && !offset)) {
page->mapping->a_ops->invalidatepage(page, 0); page->mapping->a_ops->invalidatepage(page, 0);
unlock_page(page); unlock_page(page);
return 0; /* don't care */ return 0; /* don't care */