From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761241Ab0J0Njh (ORCPT ); Wed, 27 Oct 2010 09:39:37 -0400 Received: from fieldses.org ([174.143.236.118]:40707 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755897Ab0J0Nje (ORCPT ); Wed, 27 Oct 2010 09:39:34 -0400 Date: Wed, 27 Oct 2010 09:39:25 -0400 From: "J. Bruce Fields" To: Christoph Hellwig Cc: Arnd Bergmann , Linus Torvalds , Bryan Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: nfsd changes for 2.6.37 Message-ID: <20101027133924.GB6328@fieldses.org> References: <20101026164549.GD19445@fieldses.org> <20101026214441.GC1842@fieldses.org> <20101026221156.GD1842@fieldses.org> <201010270921.37032.arnd@arndb.de> <20101027083924.GA28129@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101027083924.GA28129@infradead.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann wrote: > > If you don't hold lock_flocks throughout fcntl_setlease, the flp variable > > points to a flock that may get modified by another thread and you call > > time_out_leases() without holding lock_flocks, which it requires. Whoops, thanks for catching that. On Wed, Oct 27, 2010 at 04:39:24AM -0400, Christoph Hellwig wrote: > Do locks_alloc_lock and initialization of the heap struct file_lock > in the caller. This also avoids an entirely useless copy of the > lock structure. free the passed in structure if we are modifying > an existing lock structure. That sounds good; I'll give it a try. --b.