From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: Re: [PATCH 5/6] gfs2: stop giving out non-cluster-coherent leases Date: Wed, 4 Jul 2007 17:48:02 -0400 Message-ID: <20070704214802.GD26764@fieldses.org> References: <6e0beaf3e950494a6903571f0b5c9b61fc7bf650.1183143819.git.bfields@citi.umich.edu> <1bdef6b017f0ccb94ed76dbdd2b4cc676e5ef312.1183143820.git.bfields@citi.umich.edu> <20070630092742.GF22050@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, Marc Eshel , Steven Whitehouse To: Christoph Hellwig Return-path: Received: from mail.fieldses.org ([66.93.2.214]:57353 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757399AbXGDVsH (ORCPT ); Wed, 4 Jul 2007 17:48:07 -0400 Content-Disposition: inline In-Reply-To: <20070630092742.GF22050@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Jun 30, 2007 at 10:27:42AM +0100, Christoph Hellwig wrote: > On Fri, Jun 29, 2007 at 03:21:29PM -0400, J. Bruce Fields wrote: > > +static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl) > > +{ > > + struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host); > > + int ret = -EOPNOTSUPP; > > + > > + if (sdp->sd_args.ar_localflocks) { > > + return setlease(file, arg, fl); > > + } > > + > > + /* For now fail the delegation request. Cluster file system can not > > + allow any node in the cluster to get a local lease until it can > > + be managed centrally by the cluster file system. > > + */ > > + return ret; > > +} > > Very odd way to write this function. It should look more like: Agreed; I've reversed the sense of the test, as suggested, and got rid of the superfluous local "ret". --b. > static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl) > { > struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host); > int ret = -EOPNOTSUPP; > > /* > * For now fail the delegation request. Cluster file system can not > * allow any node in the cluster to get a local lease until it can > * be managed centrally by the cluster file system. > */ > if (!sdp->sd_args.ar_localflocks) > return -EOPNOTSUPP; > > return setlease(file, arg, fl); > } >