* [PATCH] Frontswap: fix the condition in BUG_ON
@ 2014-10-31 10:14 ` Li Haifeng
0 siblings, 0 replies; 4+ messages in thread
From: Li Haifeng @ 2014-10-31 10:14 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: open list, open list:MEMORY MANAGEMENT
>From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001
From: Haifeng Li <omycle@gmail.com>
Date: Fri, 31 Oct 2014 17:40:44 +0800
Subject: [PATCH] Frontswap: fix the condition in BUG_ON
The largest index of swap device is MAX_SWAPFILES-1. So the type
should be less than MAX_SWAPFILES.
Signed-off-by: Haifeng Li <omycle@gmail.com>
---
mm/frontswap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/frontswap.c b/mm/frontswap.c
index c30eec5..1b80c05 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
if (frontswap_ops)
frontswap_ops->init(type);
else {
- BUG_ON(type > MAX_SWAPFILES);
+ BUG_ON(type >= MAX_SWAPFILES);
set_bit(type, need_init);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] Frontswap: fix the condition in BUG_ON
@ 2014-10-31 10:14 ` Li Haifeng
0 siblings, 0 replies; 4+ messages in thread
From: Li Haifeng @ 2014-10-31 10:14 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: open list, open list:MEMORY MANAGEMENT
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Frontswap: fix the condition in BUG_ON
2014-10-31 10:14 ` Li Haifeng
@ 2014-10-31 14:10 ` Konrad Rzeszutek Wilk
-1 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-10-31 14:10 UTC (permalink / raw)
To: Li Haifeng, akpm; +Cc: open list, open list:MEMORY MANAGEMENT
On Fri, Oct 31, 2014 at 06:14:19PM +0800, Li Haifeng wrote:
> >From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001
> From: Haifeng Li <omycle@gmail.com>
> Date: Fri, 31 Oct 2014 17:40:44 +0800
> Subject: [PATCH] Frontswap: fix the condition in BUG_ON
>
> The largest index of swap device is MAX_SWAPFILES-1. So the type
> should be less than MAX_SWAPFILES.
Ok, so we would never hit this BUG_ON because of that.
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
P.S.
Andrew - are you OK picking this up?
Thank you!
>
> Signed-off-by: Haifeng Li <omycle@gmail.com>
> ---
> mm/frontswap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/frontswap.c b/mm/frontswap.c
> index c30eec5..1b80c05 100644
> --- a/mm/frontswap.c
> +++ b/mm/frontswap.c
> @@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
> if (frontswap_ops)
> frontswap_ops->init(type);
> else {
> - BUG_ON(type > MAX_SWAPFILES);
> + BUG_ON(type >= MAX_SWAPFILES);
> set_bit(type, need_init);
> }
> }
> --
> 1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Frontswap: fix the condition in BUG_ON
@ 2014-10-31 14:10 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-10-31 14:10 UTC (permalink / raw)
To: Li Haifeng, akpm; +Cc: open list, open list:MEMORY MANAGEMENT
On Fri, Oct 31, 2014 at 06:14:19PM +0800, Li Haifeng wrote:
> >From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001
> From: Haifeng Li <omycle@gmail.com>
> Date: Fri, 31 Oct 2014 17:40:44 +0800
> Subject: [PATCH] Frontswap: fix the condition in BUG_ON
>
> The largest index of swap device is MAX_SWAPFILES-1. So the type
> should be less than MAX_SWAPFILES.
Ok, so we would never hit this BUG_ON because of that.
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
P.S.
Andrew - are you OK picking this up?
Thank you!
>
> Signed-off-by: Haifeng Li <omycle@gmail.com>
> ---
> mm/frontswap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/frontswap.c b/mm/frontswap.c
> index c30eec5..1b80c05 100644
> --- a/mm/frontswap.c
> +++ b/mm/frontswap.c
> @@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
> if (frontswap_ops)
> frontswap_ops->init(type);
> else {
> - BUG_ON(type > MAX_SWAPFILES);
> + BUG_ON(type >= MAX_SWAPFILES);
> set_bit(type, need_init);
> }
> }
> --
> 1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-31 14:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 10:14 [PATCH] Frontswap: fix the condition in BUG_ON Li Haifeng
2014-10-31 10:14 ` Li Haifeng
2014-10-31 14:10 ` Konrad Rzeszutek Wilk
2014-10-31 14:10 ` Konrad Rzeszutek Wilk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.