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

From: Chen, Tim C
Date: Thu Jan 10 2019 - 18:40:12 EST


> >
> > + 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