diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 2b00bf84c05bca35f13eb671b56ac2cdb17048f4..02ce7e7bbdf5ba4da0db50e50d8d4cab49cde4a3 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -481,7 +481,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode, int i, num; unsigned long nr_pages; - num = min_t(pgoff_t, end - index, PAGEVEC_SIZE); + num = min_t(pgoff_t, end - index, PAGEVEC_SIZE - 1) + 1; nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index, (pgoff_t)num); if (nr_pages == 0)