]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: free temporary cursor in xfs_dialloc
authorEric Sandeen <sandeen@sandeen.net>
Fri, 30 Oct 2009 08:27:07 +0000 (09:27 +0100)
committerhch@lst.de <Christoph Hellwig>
Fri, 30 Oct 2009 08:27:07 +0000 (09:27 +0100)
commitbb9fe3ea201fc25156f280ff70fc96ecf8936806
tree50c017ab5f90a70878291b33c331004b36437cce
parentb87926e0d88c257dcd9818c09471cfd1e593b62a
xfs: free temporary cursor in xfs_dialloc

Commit b76266a7b1cc0359254c80ca1f56088c800d968e seems
to have a slight regression where this code path:

    if (!--searchdistance) {
        /*
         * Not in range - save last search
         * location and allocate a new inode
         */
        ...
        goto newino;
    }

doesn't free the temporary cursor (tcur) that got dup'd in
this function.

This leaks an item in the xfs_btree_cur zone, and it's caught
on module unload:

===========================================================
BUG xfs_btree_cur: Objects remaining on kmem_cache_close()
-----------------------------------------------------------

It seems like maybe a single free at the end of the function might
be cleaner, but for now put a del_cursor right in this code block
similar to the handling in the rest of the function.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_ialloc.c