Re: [PATCH] mm/madvise: set ra_pages as device max request size during ADV_POPULATE_READ

From: Matthew Wilcox
Date: Thu Feb 01 2024 - 23:15:57 EST


On Fri, Feb 02, 2024 at 10:20:29AM +0800, Ming Lei wrote:
> +static struct file *madvise_override_ra_win(struct file *f,
> + unsigned long start, unsigned long end,
> + unsigned int *old_ra_pages)
> +{
> + unsigned int io_pages;
> +
> + if (!f || !f->f_mapping || !f->f_mapping->host)
> + return NULL;

How can ->f_mapping be NULL? How can f_mapping->host be NULL?