lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1375198768.10300.9.camel@misato.fc.hp.com>
Date:	Tue, 30 Jul 2013 09:39:28 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	Xishi Qiu <qiuxishi@...wei.com>
Cc:	linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/hotplug: remove unnecessary BUG_ON in
 __offline_pages()

On Tue, 2013-07-30 at 14:49 +0800, Xishi Qiu wrote:
> I think we can remove "BUG_ON(start_pfn >= end_pfn)" in __offline_pages(),
> because in memory_block_action() "nr_pages = PAGES_PER_SECTION * sections_per_block" 
> is always greater than 0.

BUG_ON() is used for checking a condition that should never happen,
unless there is a bug.  So, to me, what you described seems to match
with the use of BUG_ON() to prevent a potential bug in the caller.

Thanks,
-Toshi


> memory_block_action()
> 	offline_pages()
> 		__offline_pages()
> 			BUG_ON(start_pfn >= end_pfn)
> 
> Signed-off-by: Xishi Qiu <qiuxishi@...wei.com>
> ---
>  mm/memory_hotplug.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index ca1dd3a..8e333f9 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1472,7 +1472,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
>  	struct zone *zone;
>  	struct memory_notify arg;
>  
> -	BUG_ON(start_pfn >= end_pfn);
>  	/* at least, alignment against pageblock is necessary */
>  	if (!IS_ALIGNED(start_pfn, pageblock_nr_pages))
>  		return -EINVAL;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ