lkml.org 
[lkml]   [2009]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/17] [LogFS] dir.c
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 = logfs_super(dir->i_sb);
> > + struct inode *inode = dentry->d_inode;
> > + struct logfs_transaction *ta;
> > + struct page *page;
> > + pgoff_t index;
> > + int ret;
> > +
> > + ta = kzalloc(sizeof(*ta), GFP_KERNEL);
> > + if (!ta)
> > + return -ENOMEM;
> > +
> > + ta->state = UNLINK_1;
> > + ta->ino = inode->i_ino;
> > +
> > + inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
> > +
> > + page = logfs_get_dd_page(dir, dentry);
> > + if (!page)
>
> kfree(ta);
>
> > + return -ENOENT;
> > + if (IS_ERR(page))
>
> kfree(ta);
>
> > + return PTR_ERR(page);

Ick! The drunkard who wrote that code ought to get fired. Thank you
for noticing, Dan.

Fixed in the git tree. And maybe I should go look for similar cases.

Jörn

--
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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-23 14:35    [W:0.114 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site