Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] Btrfs: add missing free_extent_buffer
@ 2015-05-25  9:16 Liu Bo
  2015-05-25 12:31 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Bo @ 2015-05-25  9:16 UTC (permalink / raw)
  To: linux-btrfs

read_tree_block may take a reference on the 'eb', a following
free_extent_buffer is necessary.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/extent-tree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 8b353ad..bb8a221 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7649,6 +7649,7 @@ walk_down:
 			eb = read_tree_block(root, child_bytenr, child_gen);
 			if (!eb || !extent_buffer_uptodate(eb)) {
 				ret = -EIO;
+				free_extent_buffer(eb);
 				goto out;
 			}
 
-- 
2.1.0


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

* Re: [PATCH] Btrfs: add missing free_extent_buffer
  2015-05-25  9:16 [PATCH] Btrfs: add missing free_extent_buffer Liu Bo
@ 2015-05-25 12:31 ` David Sterba
  2015-05-25 12:33   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2015-05-25 12:31 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Mon, May 25, 2015 at 05:16:40PM +0800, Liu Bo wrote:
> read_tree_block may take a reference on the 'eb', a following
> free_extent_buffer is necessary.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.cz>

And I've spotted one more in btrfs_read_tree_root and 2 other
where it was not outright obvious from the code logic.

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

* Re: [PATCH] Btrfs: add missing free_extent_buffer
  2015-05-25 12:31 ` David Sterba
@ 2015-05-25 12:33   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2015-05-25 12:33 UTC (permalink / raw)
  To: dsterba, Liu Bo, linux-btrfs

On Mon, May 25, 2015 at 02:31:56PM +0200, David Sterba wrote:
> On Mon, May 25, 2015 at 05:16:40PM +0800, Liu Bo wrote:
> > read_tree_block may take a reference on the 'eb', a following
> > free_extent_buffer is necessary.
> > 
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> 
> Reviewed-by: David Sterba <dsterba@suse.cz>
> 
> And I've spotted one more in btrfs_read_tree_root and 2 other
> where it was not outright obvious from the code logic.

Ok, it's addressed in the following patches.

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

end of thread, other threads:[~2015-05-25 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-25  9:16 [PATCH] Btrfs: add missing free_extent_buffer Liu Bo
2015-05-25 12:31 ` David Sterba
2015-05-25 12:33   ` David Sterba

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