Commit 3b826386 authored by Eric Sandeen's avatar Eric Sandeen Committed by hch@lst.de

xfs: free temporary cursor in xfs_dialloc

Commit bd169565 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: default avatarEric Sandeen <sandeen@sandeen.net>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent ba313e68
...@@ -880,6 +880,7 @@ nextag: ...@@ -880,6 +880,7 @@ nextag:
* Not in range - save last search * Not in range - save last search
* location and allocate a new inode * location and allocate a new inode
*/ */
xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR);
pag->pagl_leftrec = trec.ir_startino; pag->pagl_leftrec = trec.ir_startino;
pag->pagl_rightrec = rec.ir_startino; pag->pagl_rightrec = rec.ir_startino;
pag->pagl_pagino = pagino; pag->pagl_pagino = pagino;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment