Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189Ab3H3VpD (ORCPT ); Fri, 30 Aug 2013 17:45:03 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:35216 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755268Ab3H3VpA (ORCPT ); Fri, 30 Aug 2013 17:45:00 -0400 Date: Fri, 30 Aug 2013 22:44:52 +0100 From: Al Viro To: Linus Torvalds 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" Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Message-ID: <20130830214452.GH13318@ZenIV.linux.org.uk> References: <52200DAE.2020303@hp.com> <5220E56A.80603@hp.com> <5220F090.5050908@hp.com> <5220FD51.2010709@hp.com> <20130830205404.GF13318@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 974 Lines: 18 On Fri, Aug 30, 2013 at 02:03:59PM -0700, Linus Torvalds wrote: > Yes, yes, you haev to be careful and cannot just blindly trust the > length: you also have to check for NUL character as you are copying it > and stop if you hit it. But that's trivial. Point... Actually, I wonder if _that_ could be a solution for ->d_name.name printk races as well. Remember that story? You objected against taking spinlocks in printk, no matter how specialized and how narrow the area over which those are taken, but rcu_read_lock/rcu_read_unlock should be OK... Something like %pd expecting dentry pointer and producing dentry name. Sure, we still get garbage if we race with d_move(), but at least it's a contained garbage that way... -- 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/