From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Li Haifeng <omycle@gmail.com>, akpm@linux-foundation.org
Cc: open list <linux-kernel@vger.kernel.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>
Subject: Re: [PATCH] Frontswap: fix the condition in BUG_ON
Date: Fri, 31 Oct 2014 10:10:13 -0400 [thread overview]
Message-ID: <20141031141013.GH4704@laptop.dumpdata.com> (raw)
In-Reply-To: <CAFNq8R7xYA2GTpWE-5rHr5c-xX0ZONKHX6wSbra2MDo1M2DSHQ@mail.gmail.com>
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>
prev parent reply other threads:[~2014-10-31 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 10:14 Li Haifeng
2014-10-31 14:10 ` Konrad Rzeszutek Wilk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141031141013.GH4704@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=omycle@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox