The patch titled
     SLUB's ksize() fails for size > 2048
has been removed from the -mm tree.  Its filename was
     slubs-ksize-fails-for-size-2048.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: SLUB's ksize() fails for size > 2048
From: "Vegard Nossum" <[EMAIL PROTECTED]>

I can't pass memory allocated by kmalloc() to ksize() if it is allocated by
SLUB allocator and size is larger than (I guess) PAGE_SIZE / 2.

The error of ksize() seems to be that it does not check if the allocation
was made by SLUB or the page allocator.

Reviewed-by: Pekka Enberg <[EMAIL PROTECTED]>
Tested-by: Tetsuo Handa <[EMAIL PROTECTED]>
Cc: Christoph Lameter <[EMAIL PROTECTED]>, Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 mm/slub.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN mm/slub.c~slubs-ksize-fails-for-size-2048 mm/slub.c
--- a/mm/slub.c~slubs-ksize-fails-for-size-2048
+++ a/mm/slub.c
@@ -2558,8 +2558,12 @@ size_t ksize(const void *object)
        if (unlikely(object == ZERO_SIZE_PTR))
                return 0;
 
-       page = get_object_page(object);
+       page = virt_to_head_page(object);
        BUG_ON(!page);
+
+       if (unlikely(!PageSlab(page)))
+               return PAGE_SIZE << compound_order(page);
+
        s = page->slab;
        BUG_ON(!s);
 
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

origin.patch
git-kbuild.patch
fat-fix-printk-format-strings.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to