From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH, RFC] lockd: stop abusing file_lock_list Date: Thu, 16 Feb 2006 11:23:56 +0100 Message-ID: <20060216102355.GK4203@suse.de> References: <20060214192051.GA20751@lst.de> <1139956050.7867.64.camel@lade.trondhjem.org> <1140065071.8209.3.camel@lade.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org Return-path: Received: from ns.virtualhost.dk ([195.184.98.160]:54096 "EHLO virtualhost.dk") by vger.kernel.org with ESMTP id S1750824AbWBPKXz (ORCPT ); Thu, 16 Feb 2006 05:23:55 -0500 To: Trond Myklebust Content-Disposition: inline In-Reply-To: <1140065071.8209.3.camel@lade.trondhjem.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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. -- Jens Axboe