From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Date: Sun, 1 Sep 2013 00:27:58 +0100 Message-ID: <20130831232758.GO13318@ZenIV.linux.org.uk> References: <5220F090.5050908@hp.com> <5220FD51.2010709@hp.com> <20130830205404.GF13318@ZenIV.linux.org.uk> <20130830214452.GH13318@ZenIV.linux.org.uk> <20130831212355.GN13318@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Waiman Long , Ingo Molnar , Benjamin Herrenschmidt , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" To: Linus Torvalds Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:39282 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801Ab3HaX2N (ORCPT ); Sat, 31 Aug 2013 19:28:13 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Aug 31, 2013 at 03:49:31PM -0700, Linus Torvalds wrote: > On Sat, Aug 31, 2013 at 2:23 PM, Al Viro wrote: > > > > Hmm... OK, most of these suckers are actually doing just one component; > > we can look into 'print the ancestors as well' later, but the minimal > > variant would be something like this and it already covers a lot of those > > guys. Comments? > > Doesn't look wrong, but remember the /proc debugging thing? We > definitely wanted more than just one pathname component, and I don't > think that's completely rare. > > So I think it would be better to prepare for that, and simply print to > a local buffer, and then use the "string()" function on the end > result. Rather than do it directly from the dentry like you do, and > then having to do that widen() thing because you couldn't do the > strnlen() that that code wanted.. Actually, right now I'm debugging a variant that avoids local buffers; use is %pD3 for grandparent/parent/name, etc., up to %pD4. %pd is equivalent to %pD1 (just the dentry name). Keep in mind that things like NFS use a _lot_ of what would be %pD2 in debugging printks and the string can grow fairly long, so I'd rather live with widen() than mess with local buffers here. I'll send an updated variant when I'm more or less satisfied with it...