diff --git a/fs/squashfs/symlink.c b/fs/squashfs/symlink.c index 6ef735bd841a..ddd980d75334 100644 --- a/fs/squashfs/symlink.c +++ b/fs/squashfs/symlink.c @@ -49,6 +49,13 @@ static int squashfs_symlink_read_folio(struct file *file, struct folio *folio) /* * Skip index bytes into symlink metadata. */ + printk("folio: %p, isize: %d, idx: %d, length: %d, %s\n", + folio, i_size_read(inode), index, length, __func__); + if (i_size_read(inode) < 0) { + error = -EINVAL; + goto out; + } + if (index) { bytes = squashfs_read_metadata(sb, NULL, &block, &offset, index); @@ -93,6 +100,7 @@ static int squashfs_symlink_read_folio(struct file *file, struct folio *folio) flush_dcache_folio(folio); error = 0; out: + printk("error: %d, %s\n", error, __func__); folio_end_read(folio, error == 0); return error; } diff --git a/mm/filemap.c b/mm/filemap.c index d62150418b91..ac4675d76e2c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3787,6 +3787,7 @@ static struct folio *do_read_cache_folio(struct address_space *mapping, filler: err = filemap_read_folio(file, filler, folio); + printk("err: %d, folio: %p, folio uptod: %d, %s\n", err, folio, folio_test_uptodate(folio), __func__); if (err) { folio_put(folio); if (err == AOP_TRUNCATED_PAGE)