Re: [PATCH v2] squashfs: cache partial compressed blocks

Vincent Whitchurch
2023-05-15T12:32:32Z

On Mon, 2023-05-15 at 12:03 +0200, Christoph Hellwig wrote:
> On Fri, May 12, 2023 at 03:18:05PM +0200, Vincent Whitchurch wrote:
> >  static int squashfs_bio_read(struct super_block *sb, u64 index, int length,
> >   struct bio **biop, int *block_offset)
> >  {
> >   struct squashfs_sb_info *msblk = sb->s_fs_info;
> > + struct inode *cache_inode = msblk->cache_inode;
> > + struct address_space *cache_mapping = cache_inode ? cache_inode->i_mapping : NULL;
>
> Unless I'm badly misreading the squashfs_fill_super changes,
> cache_inode can't ever be NULL here or anywhere else in the I/O
> code.

Hmm, in this patch, cache_inode is only created if devblksize is
PAGE_SIZE, so it could be NULL if CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not
set (or if PAGE_SIZE is greater than 4 KiB), right?

I'll fix the rest of your comments in an upcoming v3. Thank you for the
review.