Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933078Ab2EKRtV (ORCPT ); Fri, 11 May 2012 13:49:21 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:22723 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932958Ab2EKRtQ (ORCPT ); Fri, 11 May 2012 13:49:16 -0400 From: Glauber Costa To: Cc: , , , Tejun Heo , Li Zefan , Greg Thelen , Suleiman Souhlal , Michal Hocko , Johannes Weiner , , Glauber Costa , Christoph Lameter , Pekka Enberg Subject: [PATCH v2 02/29] slub: fix slab_state for slub Date: Fri, 11 May 2012 14:44:04 -0300 Message-Id: <1336758272-24284-3-git-send-email-glommer@parallels.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1336758272-24284-1-git-send-email-glommer@parallels.com> References: <1336758272-24284-1-git-send-email-glommer@parallels.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 34 When the slub code wants to know if the sysfs state has already been initialized, it tests for slab_state == SYSFS. This is quite fragile, since new state can be added in the future (it is, in fact, for memcg caches). This patch fixes this behavior so the test matches >= SYSFS, as all other state does. Signed-off-by: Glauber Costa CC: Christoph Lameter CC: Pekka Enberg --- mm/slub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index ffe13fd..226e053 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5356,7 +5356,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name) { struct saved_alias *al; - if (slab_state == SYSFS) { + if (slab_state >= SYSFS) { /* * If we have a leftover link then remove it. */ -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/