From: Miaohe Lin Date: Thu, 19 May 2022 21:08:51 +0000 (-0700) Subject: mm/swap: print bad swap offset entry in get_swap_device X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=23b230ba8ac30d334afd249c9763e0d0ca583e43;p=linux.git mm/swap: print bad swap offset entry in get_swap_device If offset exceeds the si->max, print bad swap offset entry to help debug the unexpected case. Link: https://lkml.kernel.org/r/20220509131416.17553-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/mm/swapfile.c b/mm/swapfile.c index 570287b786cc8..f59abca5cea97 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1271,6 +1271,7 @@ bad_nofile: out: return NULL; put_out: + pr_err("%s: %s%08lx\n", __func__, Bad_offset, entry.val); percpu_ref_put(&si->users); return NULL; }