Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbbHBEmu (ORCPT ); Sun, 2 Aug 2015 00:42:50 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:33131 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbbHBEms (ORCPT ); Sun, 2 Aug 2015 00:42:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150731205036.GA3752@nautica> <20150801072603.GV17109@ZenIV.linux.org.uk> <20150802001402.GY17109@ZenIV.linux.org.uk> <20150802002318.GZ17109@ZenIV.linux.org.uk> <20150802014139.GA17109@ZenIV.linux.org.uk> Date: Sat, 1 Aug 2015 21:42:48 -0700 X-Google-Sender-Auth: rhyx7Pe0H1AOXRWj3oTLGlUQm84 Message-ID: Subject: Re: [git pull] vfs.git spurious ENOTDIR fix From: Linus Torvalds To: Hugh Dickins Cc: Al Viro , Dominique Martinet , "J. Bruce Fields" , Dominique Martinet , Linux Kernel Mailing List , linux-fsdevel , David Howells 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: 1884 Lines: 41 On Sat, Aug 1, 2015 at 9:06 PM, Hugh Dickins wrote: > > (I don't actually understand why the clearing of DCACHE_ENTRY_TYPE in > dentry_iput() is not of continuing concern; but don't worry, there's > plenty I don't understand - so long as you're both satisfied that > it's not a concern, no need to persuade me.) So dentry_iput() is only called as the dentry is being thrown away, and is stale. Yes, such a stale dentry can be seen by an RCU lookup, but the RCU lookups should always revalidate things after the lookup, so it shouldn't matter. The problem here was that there was a missing revalidate of the RCU lookup for an error case, so the error that _should_ have been a harmless race that got handled later by the proper validation instead turned into a real user-visible error. But we didn't use to clear the flags in dentry_iput, so before things generally "happened to work" anyway, because this rare error case didn't actually ever trigger in the first place. (And I still don't think we necessarily *should* clear the flags in dentry_iput(), but it really shouldn't be a correctness issue) > Do we have any idea why a bug introduced in v3.13 should only now > stand out, both for Dominique and for me? Has the RCU lookup somehow > become much more effective recently? So I do think that the clearing of the dentry flags exposed a situation that was harder to hit before. The fact that we now do RCU lookups even over symlinks probably does end up widening the possibilities for this happening too, although as you say, that shouldn't be very common during a kernel build. 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/