mm: nobootmem: fix sign extend problem in __free_pages_memory()
authorRuss Anderson <rja@sgi.com>
Thu, 10 May 2012 20:01:46 +0000 (13:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 May 2012 16:40:02 +0000 (09:40 -0700)
commitc928e8c32d44cbd9082455c45fd6f288b310f0f7
treeebc14ce7c3838704f0e6a28459c5597638be474f
parentafe85051b486d5d558d93ab2e509dc3bfdffc2c5
mm: nobootmem: fix sign extend problem in __free_pages_memory()

commit 6bc2e853c6b46a6041980d58200ad9b0a73a60ff upstream.

Systems with 8 TBytes of memory or greater can hit a problem where only
the the first 8 TB of memory shows up.  This is due to "int i" being
smaller than "unsigned long start_aligned", causing the high bits to be
dropped.

The fix is to change `i' to unsigned long to match start_aligned
and end_aligned.

Thanks to Jack Steiner for assistance tracking this down.

Signed-off-by: Russ Anderson <rja@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/nobootmem.c