From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: Re: On setting a lease across a cluster Date: Fri, 4 Jan 2008 15:53:04 -0500 Message-ID: <20080104205304.GA14827@fieldses.org> References: <20080104181415.GE20473@parisc-linux.org> <20080104194718.GK17112@fieldses.org> <20080104203550.GG20473@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "david m. richter" , linux-fsdevel@vger.kernel.org To: Matthew Wilcox Return-path: Received: from mail.fieldses.org ([66.93.2.214]:37417 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752565AbYADUxI (ORCPT ); Fri, 4 Jan 2008 15:53:08 -0500 Content-Disposition: inline In-Reply-To: <20080104203550.GG20473@parisc-linux.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jan 04, 2008 at 01:35:50PM -0700, Matthew Wilcox wrote: > > > > vfs_setlease() > > > > if (f_op->setlease()) > > > > res = f_op->setlease() > > > > if (res) > > > > return res; > > > > lock_kernel() > > > > generic_setlease() > > > > unlock_kernel() > > > > Why can't the filesystem call into generic_setlease() on its own? > > Because (assuming we're rid of the BKL), fcntl_setlease() needs to > acquire the spinlock and hold it while generic_setlease() runs, so > generic_setlease() can't acquire the lock. So, the problem is that fcntl_setlease() does vfs_setlease() fasync_helper() which the bkl held over both, and you want to preserve that? But what that BKL is doing is a mystery to me--the very first thing that fasync_helper() does is kmem_cache_alloc(., GFP_KERNEL). So you won't be introducing any new problem if you lock those two operations separately. Unless I'm totally missing something. --b.