On 12/8/24 13:30, Matthew Wilcox wrote:
On Mon, Aug 12, 2024 at 11:46:34AM +1000, Greg Ungerer wrote:
@@ -125,20 +121,14 @@ static int romfs_read_folio(struct file *file, struct folio *folio)
ret = romfs_dev_read(inode->i_sb, pos, buf, fillsize);
if (ret < 0) {
- SetPageError(page);
fillsize = 0;
ret = -EIO;
}
}
- if (fillsize < PAGE_SIZE)
- memset(buf + fillsize, 0, PAGE_SIZE - fillsize);
- if (ret == 0)
- SetPageUptodate(page);
-
- flush_dcache_page(page);
- kunmap(page);
- unlock_page(page);
+ buf = folio_zero_tail(folio, fillsize, buf);
I think this should have been:
buf = folio_zero_tail(folio, fillsize, buf + fillsize);
Can you give that a try?
Yep, that fixes it.
Thanks
Greg