From: Christoph Lameter <cl@linux.com>
To: Chen Gang <gang.chen@asianux.com>
Cc: Pekka Enberg <penberg@kernel.org>,
mpm@selenic.com, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/slub.c: add parameter length checking for alloc_loc_track()
Date: Fri, 12 Jul 2013 13:49:49 +0000 [thread overview]
Message-ID: <0000013fd3250e40-1832fd38-ede3-41af-8fe3-5a0c10f5e5ce-000000@email.amazonses.com> (raw)
In-Reply-To: <51DF5404.4060004@asianux.com>
On Fri, 12 Jul 2013, Chen Gang wrote:
> Since alloc_loc_track() will alloc additional space, and already knows
> about 'max', so need be sure of 'max' must be larger than 't->count'.
alloc_loc_track is only called if t->count > max from add_location:
/*
* Not found. Insert new tracking element.
*/
if (t->count >= t->max && !alloc_loc_track(t, 2 * t->max, GFP_ATOMIC))
return 0;
> The caller may not notice about it, e.g. call from add_location() in
> "mm/slub.c", which only let "max = 2 * max" when "t->count >= t->max"
That call already has the condition checked before the call. The only
other caller is list_locations which calls alloc_loc_track when t->count == 0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-07-12 13:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 8:07 [PATCH] mm/slub.c: remove 'per_cpu' which is useless variable Chen Gang
2013-07-11 6:45 ` Pekka Enberg
2013-07-11 6:50 ` Chen Gang
2013-07-11 16:45 ` Christoph Lameter
2013-07-11 18:28 ` Pekka Enberg
2013-07-11 20:16 ` Christoph Lameter
2013-07-11 23:52 ` Chen Gang
2013-07-12 0:23 ` [PATCH v2] " Chen Gang
2013-07-12 0:55 ` [PATCH] mm/slub.c: add parameter length checking for alloc_loc_track() Chen Gang
2013-07-12 13:49 ` Christoph Lameter [this message]
2013-07-15 0:17 ` Chen Gang
2013-07-15 15:16 ` Christoph Lameter
2013-07-16 1:03 ` Chen Gang
2013-07-17 15:03 ` Christoph Lameter
2013-07-18 0:43 ` Chen Gang
2013-07-18 13:45 ` Christoph Lameter
2013-07-19 0:05 ` Chen Gang F T
2013-07-19 13:57 ` Christoph Lameter
2013-07-22 0:27 ` Chen Gang
2013-07-22 0:42 ` Wanpeng Li
2013-07-22 1:30 ` Chen Gang
2013-07-22 0:42 ` Wanpeng Li
2013-07-12 13:45 ` [PATCH v2] mm/slub.c: remove 'per_cpu' which is useless variable Christoph Lameter
2013-07-15 0:08 ` Chen Gang
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=0000013fd3250e40-1832fd38-ede3-41af-8fe3-5a0c10f5e5ce-000000@email.amazonses.com \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=gang.chen@asianux.com \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@kernel.org \
/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