RE: [v5 PATCH 1/2] mm: swap: check if swap backing device is congested or not

Chen, Tim C
2019-01-10T23:40:12Z

> >
> > + if (si->flags & (SWP_BLKDEV | SWP_FS)) {
>
> I re-read your discussion with Tim and I must say the reasoning behind this
> test remain foggy.

I was worried that the dereference

inode = si->swap_file->f_mapping->host;

is not always safe for corner cases.

So the test makes sure that the dereference is valid.

>
> What goes wrong if we just remove it?

If the dereference to get inode is always safe, we can remove it.

Thanks.

Tim