From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814Ab1GRTrK (ORCPT ); Mon, 18 Jul 2011 15:47:10 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:37880 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829Ab1GRTrI (ORCPT ); Mon, 18 Jul 2011 15:47:08 -0400 Date: Mon, 18 Jul 2011 20:47:03 +0100 From: Al Viro To: Linus Torvalds Cc: Hugh Dickins , Andrew Morton , Nick Piggin , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] vfs: fix race in rcu lookup of pruned dentry Message-ID: <20110718194703.GI11013@ZenIV.linux.org.uk> References: <20110717231610.GR11013@ZenIV.linux.org.uk> <20110718002524.GU11013@ZenIV.linux.org.uk> <20110718020818.GW11013@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 On Mon, Jul 18, 2011 at 12:33:28PM -0700, Linus Torvalds wrote: > Which just makes me suspect that it's *another* case of bug in the > dentry_kill() sequence. I think the dentry_rcuwalk_barrier() thing is > crap: it doesn't *cover* the d_inode change with the write lock, it > just puts that "barrier" there, which is bogus. You can get a > successful read of the changed inode without ever failing the read > lock sequence! Huh? We do __d_drop() in there, and do that before we start messing with ->d_inode. And barrier here will make sure that anything that might have found this sucker prior to that __d_drop() will fail ->d_seq check - it bumps ->d_seq by 2... As long as ->d_inode change happens under ->d_lock and ->d_seq is bumped along with that change, we should be fine, no?