public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
@ 2012-06-12  4:20 Dave Chinner
  2012-06-15 12:39 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Chinner @ 2012-06-12  4:20 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

When we fail to find an matching extent near the requested extent
specification during a left-right distance search in
xfs_alloc_ag_vextent_near, we fail to free the original cursor that
we used to look up the XFS_BTNUM_CNT tree and hence leak it.

Reported-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/xfs_alloc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 229641f..70878aa 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -1080,6 +1080,7 @@ restart:
 			goto restart;
 		}
 
+		xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
 		trace_xfs_alloc_size_neither(args);
 		args->agbno = NULLAGBLOCK;
 		return 0;
-- 
1.7.10

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
  2012-06-12  4:20 [PATCH] xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near Dave Chinner
@ 2012-06-15 12:39 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2012-06-15 12:39 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Tue, Jun 12, 2012 at 02:20:26PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> When we fail to find an matching extent near the requested extent
> specification during a left-right distance search in
> xfs_alloc_ag_vextent_near, we fail to free the original cursor that
> we used to look up the XFS_BTNUM_CNT tree and hence leak it.
> 
> Reported-by: Chris J Arges <chris.j.arges@canonical.com>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

Looks correct for now, but mid-term this function absolutely needs
a restructuring with good exit labels and a posisble a split up into
multiple helpers.

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-15 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12  4:20 [PATCH] xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near Dave Chinner
2012-06-15 12:39 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox