From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?SsO2cm4=?= Engel Subject: Re: [PATCH 5/17] [LogFS] dir.c Date: Mon, 23 Nov 2009 14:32:15 +0100 Message-ID: <20091123133214.GB18889@logfs.org> References: <20091120181113.GA2159@logfs.org> <20091123111744.GA17527@bicker> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org To: Dan Carpenter Return-path: Received: from lazybastard.de ([212.112.238.170]:46633 "EHLO longford.logfs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbZKWNcQ (ORCPT ); Mon, 23 Nov 2009 08:32:16 -0500 Content-Disposition: inline In-Reply-To: <20091123111744.GA17527@bicker> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 23 November 2009 13:17:44 +0200, Dan Carpenter wrote: > On Fri, Nov 20, 2009 at 08:37:29PM +0100, Joern Engel wrote: > > +static int logfs_unlink(struct inode *dir, struct dentry *dentry) > > +{ > > + struct logfs_super *super =3D logfs_super(dir->i_sb); > > + struct inode *inode =3D dentry->d_inode; > > + struct logfs_transaction *ta; > > + struct page *page; > > + pgoff_t index; > > + int ret; > > + > > + ta =3D kzalloc(sizeof(*ta), GFP_KERNEL); > > + if (!ta) > > + return -ENOMEM; > > + > > + ta->state =3D UNLINK_1; > > + ta->ino =3D inode->i_ino; > > + > > + inode->i_ctime =3D dir->i_ctime =3D dir->i_mtime =3D CURRENT_TIME= ; > > + > > + page =3D logfs_get_dd_page(dir, dentry); > > + if (!page) >=20 > kfree(ta); >=20 > > + return -ENOENT; > > + if (IS_ERR(page)) >=20 > kfree(ta); >=20 > > + return PTR_ERR(page); Ick! The drunkard who wrote that code ought to get fired. Thank you for noticing, Dan. =46ixed in the git tree. And maybe I should go look for similar cases. J=C3=B6rn --=20 You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is. -- Rob Pike -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html