Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756126Ab3H3VEC (ORCPT ); Fri, 30 Aug 2013 17:04:02 -0400 Received: from mail-ve0-f174.google.com ([209.85.128.174]:35493 "EHLO mail-ve0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530Ab3H3VEA (ORCPT ); Fri, 30 Aug 2013 17:04:00 -0400 MIME-Version: 1.0 In-Reply-To: <20130830205404.GF13318@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> Date: Fri, 30 Aug 2013 14:03:59 -0700 X-Google-Sender-Auth: Be9SiIRfzB-xTmM2p_TFijSizN0 Message-ID: Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount From: Linus Torvalds To: Al Viro 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" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1020 Lines: 23 On Fri, Aug 30, 2013 at 1:54 PM, Al Viro wrote: > > Not really. Sure, you'll retry it if you race with d_move(); that's not > the real problem - access past the end of the object containing ->d_name.name > would screw you and that's what ->d_lock is preventing there. Delayed freeing > of what ->d_name is pointing into is fine, but it's not the only way to get > hurt there... Umm? We follow d->d_name.name without d_lock under RCU all the time - that's what the pathname lookup is all about, after all. 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. Why would d_prepend be any different? Linus -- 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/