]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
[XFS] Fix a possible metadata buffer (AGFL) refcount leak when fixing an
authorNathan Scott <nathans@sgi.com>
Mon, 8 May 2006 09:51:58 +0000 (19:51 +1000)
committerNathan Scott <nathans@sgi.com>
Mon, 8 May 2006 09:51:58 +0000 (19:51 +1000)
AG freelist.

SGI-PV: 952681
SGI-Modid: xfs-linux-melb:xfs-kern:25902a

Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_alloc.c

index 64ee07db0d5e15d19f7429ce2673d70ee1ff3afb..8558226281c45a61d7a0bc056505246e705a372b 100644 (file)
@@ -1942,8 +1942,10 @@ xfs_alloc_fix_freelist(
                /*
                 * Allocate as many blocks as possible at once.
                 */
-               if ((error = xfs_alloc_ag_vextent(&targs)))
+               if ((error = xfs_alloc_ag_vextent(&targs))) {
+                       xfs_trans_brelse(tp, agflbp);
                        return error;
+               }
                /*
                 * Stop if we run out.  Won't happen if callers are obeying
                 * the restrictions correctly.  Can happen for free calls
@@ -1960,6 +1962,7 @@ xfs_alloc_fix_freelist(
                                return error;
                }
        }
+       xfs_trans_brelse(tp, agflbp);
        args->agbp = agbp;
        return 0;
 }