From: Trond Myklebust Subject: Re: [PATCH, RFC] lockd: stop abusing file_lock_list Date: Thu, 16 Feb 2006 08:46:21 -0500 Message-ID: <1140097582.8891.7.camel@lade.trondhjem.org> References: <20060214192051.GA20751@lst.de> <1139956050.7867.64.camel@lade.trondhjem.org> <1140065071.8209.3.camel@lade.trondhjem.org> <20060216102355.GK4203@suse.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org Return-path: Received: from pat.uio.no ([129.240.130.16]:40623 "EHLO pat.uio.no") by vger.kernel.org with ESMTP id S1161119AbWBPNqm (ORCPT ); Thu, 16 Feb 2006 08:46:42 -0500 To: Jens Axboe In-Reply-To: <20060216102355.GK4203@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 2006-02-16 at 11:23 +0100, Jens Axboe wrote: > On Wed, Feb 15 2006, Trond Myklebust wrote: > > static void nlmclnt_locks_release_private(struct file_lock *fl) > > { > > nlm_put_lockowner(fl->fl_u.nfs_fl.owner); > > fl->fl_ops = NULL; > > + if (!list_empty(&fl->fl_u.nfs_fl.list)) > > + list_del(&fl->fl_u.nfs_fl.list); > > } > > This looks fishy, if invoked twice both will return !list_empty() - > list_del_init()? > > Why not just always use list_del_init(), if you have to add these checks > anyways? A double list_del_init() doesn't cause any harm. True, but calling the above twice would be a nasty bug anyway: it is the destructor for the private area of the lock. Cheers, Trond