The patch titled Subject: mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2 has been added to the -mm tree. Its filename is mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> Subject: mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2 add comment Link: http://lkml.kernel.org/r/bbc7bda7-62d0-df1a-23ef-d369e865bdca@xxxxxxxxxxxxxxxxx Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/swap_state.c~mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2 +++ a/mm/swap_state.c @@ -543,7 +543,8 @@ struct page *swap_cluster_readahead(swp_ if (!mask) goto skip; - if (si->flags & (SWP_BLKDEV | SWP_FS)) { + /* Test swap type to make sure the dereference is safe */ + if (likely(si->flags & (SWP_BLKDEV | SWP_FS))) { struct inode *inode = si->swap_file->f_mapping->host; if (inode_read_congested(inode)) goto skip; _ Patches currently in -mm which might be from yang.shi@xxxxxxxxxxxxxxxxx are mm-swap-check-if-swap-backing-device-is-congested-or-not.patch mm-swap-check-if-swap-backing-device-is-congested-or-not-fix-2.patch mm-swap-add-comment-for-swap_vma_readahead.patch mm-swap-use-mem_cgroup_is_root-instead-of-deferencing-css-parent.patch