All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: free up block groups after everything
@ 2013-10-07 19:16 Josef Bacik
  2013-10-08  1:22 ` Liu Bo
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2013-10-07 19:16 UTC (permalink / raw)
  To: linux-btrfs

If we abort a transaction we will do the tree log cleanup at unmount, but this
happens after we free up the block groups.  This makes all the leak detection
warnings go off because we think we've leaked space but in reality we just
haven't cleaned it up yet.  So instead do the block group cleanup stuff after
free'ing the fs roots so we don't get these warnings.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
---
 fs/btrfs/disk-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index fdc75ab..419968e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3637,12 +3637,12 @@ int close_ctree(struct btrfs_root *root)
 		       percpu_counter_sum(&fs_info->delalloc_bytes));
 	}
 
-	btrfs_free_block_groups(fs_info);
-
 	btrfs_stop_all_workers(fs_info);
 
 	del_fs_roots(fs_info);
 
+	btrfs_free_block_groups(fs_info);
+
 	free_root_pointers(fs_info, 1);
 
 	iput(fs_info->btree_inode);
-- 
1.8.3.1


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

* Re: [PATCH] Btrfs: free up block groups after everything
  2013-10-07 19:16 [PATCH] Btrfs: free up block groups after everything Josef Bacik
@ 2013-10-08  1:22 ` Liu Bo
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Bo @ 2013-10-08  1:22 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs

On Mon, Oct 07, 2013 at 03:16:01PM -0400, Josef Bacik wrote:
> If we abort a transaction we will do the tree log cleanup at unmount, but this
> happens after we free up the block groups.  This makes all the leak detection
> warnings go off because we think we've leaked space but in reality we just
> haven't cleaned it up yet.  So instead do the block group cleanup stuff after
> free'ing the fs roots so we don't get these warnings.  Thanks,

Looks good.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

> 
> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
> ---
>  fs/btrfs/disk-io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index fdc75ab..419968e 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3637,12 +3637,12 @@ int close_ctree(struct btrfs_root *root)
>  		       percpu_counter_sum(&fs_info->delalloc_bytes));
>  	}
>  
> -	btrfs_free_block_groups(fs_info);
> -
>  	btrfs_stop_all_workers(fs_info);
>  
>  	del_fs_roots(fs_info);
>  
> +	btrfs_free_block_groups(fs_info);
> +
>  	free_root_pointers(fs_info, 1);
>  
>  	iput(fs_info->btree_inode);
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-10-08  1:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07 19:16 [PATCH] Btrfs: free up block groups after everything Josef Bacik
2013-10-08  1:22 ` Liu Bo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.