From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by kanga.kvack.org (Postfix) with ESMTP id C8B796B0031 for ; Thu, 10 Oct 2013 22:37:45 -0400 (EDT) Received: by mail-pd0-f171.google.com with SMTP id g10so3496297pdj.30 for ; Thu, 10 Oct 2013 19:37:45 -0700 (PDT) Subject: Re: [PATCH] RAID5: Change kmem_cache name string of RAID 4/5/6 stripe cache Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Brassow Jonathan In-Reply-To: <52572F1C.8080905@zytor.com> Date: Thu, 10 Oct 2013 21:37:40 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <5CBD865B-7865-4FE2-ABFE-AFFD9736D256@redhat.com> References: <1379646960-12553-1-git-send-email-jbrassow@redhat.com> <1379646960-12553-2-git-send-email-jbrassow@redhat.com> <52572F1C.8080905@zytor.com> Sender: owner-linux-mm@kvack.org List-ID: To: "H. Peter Anvin" Cc: linux-raid@vger.kernel.org, linux-mm@kvack.org, cl@linux.com I think I can NACK this patch. It was fixed properly in the kmem code. brassow On Oct 10, 2013, at 5:50 PM, H. Peter Anvin wrote: > On 09/19/2013 08:16 PM, Jonathan Brassow wrote: >> The unique portion of the kmem_cache name used when dm-raid is = creating >> a RAID 4/5/6 array is the memory address of it's associated 'mddev' >> structure. This is not always unique. The memory associated >> with the 'mddev' structure can be freed and a future 'mddev' = structure >> can be allocated from the exact same spot. This causes an identical >> name to the old cache to be created when kmem_cache_create is called. >> If an old name is still present amoung slab_caches due to cache = merging, >> the call will fail. This is not theoretical, I see this regularly = when >> performing device-mapper RAID 4/5/6 tests (although, strangely only = on >> Fedora-19). >>=20 >> Making the unique portion of the kmem_cache name based on jiffies = fixes >> this problem. >>=20 >> Signed-off-by: Jonathan Brassow >> --- >> drivers/md/raid5.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >>=20 >> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c >> index 7ff4f25..f731ce9 100644 >> --- a/drivers/md/raid5.c >> +++ b/drivers/md/raid5.c >> @@ -1618,7 +1618,7 @@ static int grow_stripes(struct r5conf *conf, = int num) >> "raid%d-%s", conf->level, mdname(conf->mddev)); >> else >> sprintf(conf->cache_name[0], >> - "raid%d-%p", conf->level, conf->mddev); >> + "raid%d-%llu", conf->level, get_jiffies_64()); >> sprintf(conf->cache_name[1], "%s-alt", conf->cache_name[0]); >>=20 >> conf->active_name =3D 0; >>=20 >=20 > And it is not possible to create two inside the same jiffy? Seems > unlikely at best. >=20 > Why not just use a simple counter? >=20 > -hpa >=20 > -- > To unsubscribe from this list: send the line "unsubscribe linux-raid" = in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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: email@kvack.org