From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753912Ab0DTPyu (ORCPT ); Tue, 20 Apr 2010 11:54:50 -0400 Received: from ey-out-2122.google.com ([74.125.78.27]:31839 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014Ab0DTPys (ORCPT ); Tue, 20 Apr 2010 11:54:48 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ppqAG2DjN7AMqa1VL96F32kkLMVUg8QyJ2zzKfXIqW+tZT5BOrkK+vfHWnnaVRxIR8 mY3wK6s4FWmXEXO6TFnJaU87U2inod0fX8np6YkF2AXZIBtEQ1PKZXbSWtZo39/GnvEI jXpgfp/bbgWOIJk5husGvcaURbn6s4nzb+Prc= Date: Wed, 21 Apr 2010 18:55:47 +0300 From: Alexey Dobriyan To: Michael Ellerman Cc: Christian Kujau , "Rafael J. Wysocki" , Linux Kernel Mailing List , linuxppc-dev@ozlabs.org, schwab@linux-m68k.org, Kernel Testers List , Maciej Rutecki Subject: Re: [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316 Message-ID: <20100421155547.GA4222@x200> References: <1271765898.4324.2.camel@concordia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1271765898.4324.2.camel@concordia> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2010 at 10:18:18PM +1000, Michael Ellerman wrote: > On Mon, 2010-04-19 at 23:45 -0700, Christian Kujau wrote: > --- a/fs/proc/proc_devtree.c > +++ b/fs/proc/proc_devtree.c > @@ -175,6 +175,24 @@ retry: > return fixed_name; > } > > +static const char *unslash_name(const char *name) > +{ > + char *p, *fixed_name; > + > + fixed_name = kstrdup(name); > + if (!fixed_name) { > + printk(KERN_ERR "device-tree: Out of memory trying to unslash " > + "name \"%s\"\n", name); > + return name; > + } > + > + p = fixed_name; > + while ((p = strstr(p, "/"))) > + *p++ = '_'; This is wasteful. :-) Also, I hope we won't spit message every time allocation fail. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by ozlabs.org (Postfix) with ESMTP id 4BE3BB7D08 for ; Wed, 21 Apr 2010 01:54:48 +1000 (EST) Received: by ewy26 with SMTP id 26so1950714ewy.23 for ; Tue, 20 Apr 2010 08:54:46 -0700 (PDT) Date: Wed, 21 Apr 2010 18:55:47 +0300 From: Alexey Dobriyan To: Michael Ellerman Subject: Re: [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316 Message-ID: <20100421155547.GA4222@x200> References: <1271765898.4324.2.camel@concordia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1271765898.4324.2.camel@concordia> Cc: Christian Kujau , Linux Kernel Mailing List , "Rafael J. Wysocki" , linuxppc-dev@ozlabs.org, schwab@linux-m68k.org, Kernel Testers List , Maciej Rutecki List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Apr 20, 2010 at 10:18:18PM +1000, Michael Ellerman wrote: > On Mon, 2010-04-19 at 23:45 -0700, Christian Kujau wrote: > --- a/fs/proc/proc_devtree.c > +++ b/fs/proc/proc_devtree.c > @@ -175,6 +175,24 @@ retry: > return fixed_name; > } > > +static const char *unslash_name(const char *name) > +{ > + char *p, *fixed_name; > + > + fixed_name = kstrdup(name); > + if (!fixed_name) { > + printk(KERN_ERR "device-tree: Out of memory trying to unslash " > + "name \"%s\"\n", name); > + return name; > + } > + > + p = fixed_name; > + while ((p = strstr(p, "/"))) > + *p++ = '_'; This is wasteful. :-) Also, I hope we won't spit message every time allocation fail. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316 Date: Tue, 20 Apr 2010 15:54:53 +0000 (UTC) Message-ID: <20100421155547.GA4222@x200> References: <1271765898.4324.2.camel@concordia> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=v4NafJD1dpsKSspMNG6vb8zhBVrswd1p8bPd+jr8pTI=; b=DWk1m8ChQ3P16CVX5SoOWG0u3tmjKpUV13BbeUyO/FbEUCvBJVnxHhlyh5W/hzcNab mQ93R9ycPgD6O6kARVlIVATMHG9pL3vpf6llFRkaiUQ0mzQWYsumDSUbXffW92rFfkOP JKWTG+jEJ5dwrhFbXzKbct/3GI6skGChIabOI= Date: Wed, 21 Apr 2010 18:55:47 +0300 Content-Disposition: inline In-Reply-To: <1271765898.4324.2.camel@concordia> Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Ellerman Cc: Christian Kujau , "Rafael J. Wysocki" , Linux Kernel Mailing List , linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org, Kernel Testers List , Maciej Rutecki On Tue, Apr 20, 2010 at 10:18:18PM +1000, Michael Ellerman wrote: > On Mon, 2010-04-19 at 23:45 -0700, Christian Kujau wrote: > --- a/fs/proc/proc_devtree.c > +++ b/fs/proc/proc_devtree.c > @@ -175,6 +175,24 @@ retry: > return fixed_name; > } > > +static const char *unslash_name(const char *name) > +{ > + char *p, *fixed_name; > + > + fixed_name = kstrdup(name); > + if (!fixed_name) { > + printk(KERN_ERR "device-tree: Out of memory trying to unslash " > + "name \"%s\"\n", name); > + return name; > + } > + > + p = fixed_name; > + while ((p = strstr(p, "/"))) > + *p++ = '_'; This is wasteful. :-) Also, I hope we won't spit message every time allocation fail.