From: Christoph Hellwig <hch@sgi.com>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, linux-xfs@oss.sgi.com
Subject: [PATCH] fix kmem_cache_size() for new slab poisoning
Date: Tue, 11 Mar 2003 16:59:23 -0500 [thread overview]
Message-ID: <20030311165923.A25018@sgi.com> (raw)
The new slab poisoning code broke kmem_cache_size(), it now returns
a too large size as the poisoning area after the object is includes.
XFS's kmem_zone_zalloc thus overwrites exactly that area and triggers
the new checks everytime such an object is freed again.
I don't recommend using XFS on BK-current without this patch applied :)
--- 1.68/mm/slab.c Sat Mar 8 23:50:36 2003
+++ edited/mm/slab.c Tue Mar 11 15:15:44 2003
@@ -2041,11 +2041,16 @@
unsigned int kmem_cache_size(kmem_cache_t *cachep)
{
+ unsigned int objlen = cachep->objsize;
+
#if DEBUG
if (cachep->flags & SLAB_RED_ZONE)
- return (cachep->objsize - 2*BYTES_PER_WORD);
+ objlen -= 2*BYTES_PER_WORD;
+ if (cachep->flags & SLAB_STORE_USER)
+ objlen -= BYTES_PER_WORD;
#endif
- return cachep->objsize;
+
+ return objlen;
}
kmem_cache_t * kmem_find_general_cachep (size_t size, int gfpflags)
reply other threads:[~2003-03-11 14:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030311165923.A25018@sgi.com \
--to=hch@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@oss.sgi.com \
--cc=torvalds@transmeta.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