Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396Ab0AICLc (ORCPT ); Fri, 8 Jan 2010 21:11:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752972Ab0AICLa (ORCPT ); Fri, 8 Jan 2010 21:11:30 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:49905 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274Ab0AICL3 (ORCPT ); Fri, 8 Jan 2010 21:11:29 -0500 Date: Sat, 9 Jan 2010 02:11:25 +0000 From: Al Viro To: Linus Torvalds Cc: Trond Myklebust , Andi Kleen , linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [RFC PATCH 0/2] Fix up the NFS mmap code Message-ID: <20100109021124.GG30528@ZenIV.linux.org.uk> References: <1262913974.2659.101.camel@localhost> <20100109005624.7473.33215.stgit@localhost.localdomain> <20100109013825.GD30528@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.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1388 Lines: 30 On Fri, Jan 08, 2010 at 05:57:27PM -0800, Linus Torvalds wrote: > > > On Sat, 9 Jan 2010, Al Viro wrote: > > > > readdir() is certainly a red herring. > > That's the one that lockdep reports, though. I still don't see why. Afaik, > the only place where NFS gets an inode is nfs_fhget(), and that seems to > do things correctly. Well, sure - it steps on i_mutex-before-mmmap_sem first from ls somewhere and records the ordering for posterity. Then NFS steps into mmap() (on a different inode) and gets conflicting ordering. It would be a false positive if rules for NFS *really* had been different and it could safely grab i_mutex on NFS inodes inside mmap_sem. It can't. The rules really are the same. And readdir is just the earliest case of kernel stepping on mmap_sem while holding *some* i_mutex. write() is another and there i_mutex can very well be the same as in case of mmap(). lockdep doesn't make a distinction (and really, how many paths reinforcing the normal lock ordering would you record?), but if we'd given i_mutex of NFS regular files a class of its own, we'd see a warning with nfs write instead of readdir... -- 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/