From: Arnd Bergmann Subject: Re: [PATCH] Remove BKL from fs/locks.c Date: Tue, 14 Sep 2010 22:39:02 +0200 Message-ID: <201009142239.02904.arnd@arndb.de> References: <201009142206.54130.arnd@arndb.de> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Christoph Hellwig , Trond Myklebust , "J. Bruce Fields" , Miklos Szeredi , Frederic Weisbecker , Ingo Molnar , John Kacur , Stephen Rothwell , Andrew Morton , Thomas Gleixner To: Linus Torvalds Return-path: Received: from moutng.kundenserver.de ([212.227.17.9]:53349 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753458Ab0INUkS (ORCPT ); Tue, 14 Sep 2010 16:40:18 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tuesday 14 September 2010 22:20:22 Linus Torvalds wrote: > End result: anybody who uses the old exports will just not link at > all, and all in-kernel users (ie lockd etc) will now very explicitly > have that xyz_bkl() use. > > After that one release, we can re-introduce the old names without the > bkl, and let filesystems and other subsystems just decide that they > don't want the bkl version one by one. So that first phase would be > basically a no-op with an interface rename just so that the rest could > then be done piece-meal. Hmm, maybe I'm misunderstanding part of that plan, but I think it won't work because the BKL in there seems to protect all struct file_lock instances and they are passed around to other code, most importantly lockd. The file_locks themselves can be accessed both using sys_flock() etc locally and using afs/nfs/coda/... exported file systems from other systems. AFAICT we could end up with lockd changing data under BKL while a sys_flock() accesses the same data under file_lock_lock, with no mutual exclusion between the two. Arnd