diff mbox series

[05/15] mm/swap: print bad swap offset entry in get_swap_device

Message ID 20220509131416.17553-6-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for swap | expand

Commit Message

Miaohe Lin May 9, 2022, 1:14 p.m. UTC
If offset exceeds the si->max, print bad swap offset entry to help debug
the unexpected case.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/swapfile.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Hildenbrand May 12, 2022, 1:32 p.m. UTC | #1
On 09.05.22 15:14, Miaohe Lin wrote:
> If offset exceeds the si->max, print bad swap offset entry to help debug
> the unexpected case.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: David Hildenbrand <david@redhat.com>
Oscar Salvador May 18, 2022, 9:36 a.m. UTC | #2
On Mon, May 09, 2022 at 09:14:06PM +0800, Miaohe Lin wrote:
> If offset exceeds the si->max, print bad swap offset entry to help debug
> the unexpected case.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  mm/swapfile.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 0aee6286d6a7..d4b81ca887c0 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -1272,6 +1272,7 @@ struct swap_info_struct *get_swap_device(swp_entry_t entry)
>  out:
>  	return NULL;
>  put_out:
> +	pr_err("%s: %s%08lx\n", __func__, Bad_offset, entry.val);
>  	percpu_ref_put(&si->users);
>  	return NULL;
>  }
> -- 
> 2.23.0
> 
>
diff mbox series

Patch

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 0aee6286d6a7..d4b81ca887c0 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1272,6 +1272,7 @@  struct swap_info_struct *get_swap_device(swp_entry_t entry)
 out:
 	return NULL;
 put_out:
+	pr_err("%s: %s%08lx\n", __func__, Bad_offset, entry.val);
 	percpu_ref_put(&si->users);
 	return NULL;
 }