From: Steven Rostedt Date: Thu, 22 Dec 2011 23:17:51 +0000 (+1100) Subject: md: Fix userspace free_pages() macro X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~1205^2~32 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=38059ec2bd2ce9e4709f49f34795aa0944287908;p=mirror_ubuntu-zesty-kernel.git md: Fix userspace free_pages() macro While using etags to find free_pages(), I stumbled across this debug definition of free_pages() that is to be used while debugging some raid code in userspace. The __get_free_pages() allocates the correct size, but the free_pages() does not match. free_pages(), like __get_free_pages(), takes an order and not a size. Acked-by: H. Peter Anvin Signed-off-by: Steven Rostedt Signed-off-by: NeilBrown --- diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index 2b59cc824395..53272e9860a7 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h @@ -132,7 +132,7 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, PROT_READ|PROT_WRITE, \ MAP_PRIVATE|MAP_ANONYMOUS,\ 0, 0)) -# define free_pages(x, y) munmap((void *)(x), (y)*PAGE_SIZE) +# define free_pages(x, y) munmap((void *)(x), PAGE_SIZE << (y)) static inline void cpu_relax(void) {