From: "J. Bruce Fields" Subject: Re: [PATCH 12/17] lockd: handle fl_notify callbacks Date: Tue, 10 Apr 2007 17:55:12 -0400 Message-ID: <20070410215512.GM7502@fieldses.org> References: <20070409184352.GC28716@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@osdl.org, Trond Myklebust , Marc Eshel , linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mail.fieldses.org ([66.93.2.214]:46705 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310AbXDJVzR (ORCPT ); Tue, 10 Apr 2007 17:55:17 -0400 Content-Disposition: inline In-Reply-To: <20070409184352.GC28716@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Apr 09, 2007 at 07:43:52PM +0100, Christoph Hellwig wrote: > On Thu, Apr 05, 2007 at 07:41:02PM -0400, J. Bruce Fields wrote: > > + if (block->b_fl) > > + kfree(block->b_fl); > > kfree(NULL) is fine. Whoops, thanks, will fix. > > +static void > > +nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf, > > + int result) > > +{ > > + block->b_flags |= B_GOT_CALLBACK; > > + if (result == 0) > > + block->b_granted = 1; > > + else > > + block->b_flags |= B_TOO_LATE; > > + if (conf) { > > + block->b_fl = kzalloc(sizeof(struct file_lock), GFP_KERNEL); > > + if (block->b_fl) > > + locks_copy_lock(block->b_fl, conf); > > + } > > +} > > Shouldn't there be a way to propagate errors back to the caller when > the kzalloc fails? That's fixed in a later patch, so there may be a problem with how I split up those patches--I'll check. --b.