Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group()
@ 2011-04-20  8:37 Li Zefan
  2011-04-20 12:02 ` Chris Mason
  2011-04-20 12:22 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Li Zefan @ 2011-04-20  8:37 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org; +Cc: lidongyang

Since commit dc89e9824464e91fa0b06267864ceabe3186fd8b, we've changed
to use a specific slab for alocation of free_space items.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 fs/btrfs/free-space-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 11d2e9c..13c29b1 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2301,7 +2301,7 @@ int btrfs_trim_block_group(struct btrfs_block_group_cache *block_group,
 			start = entry->offset;
 			bytes = min(entry->bytes, end - start);
 			unlink_free_space(block_group, entry);
-			kfree(entry);
+			kmem_cache_free(btrfs_free_space_cachep, entry);
 		}
 
 		spin_unlock(&block_group->tree_lock);
-- 1.7.3.1 

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

* Re: [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group()
  2011-04-20  8:37 [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group() Li Zefan
@ 2011-04-20 12:02 ` Chris Mason
  2011-04-20 12:22 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Mason @ 2011-04-20 12:02 UTC (permalink / raw)
  To: Li Zefan; +Cc: linux-btrfs@vger.kernel.org, lidongyang

Excerpts from Li Zefan's message of 2011-04-20 04:37:39 -0400:
> Since commit dc89e9824464e91fa0b06267864ceabe3186fd8b, we've changed
> to use a specific slab for alocation of free_space items.

Oh, nice catch.  Thanks!

-chris

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

* Re: [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group()
  2011-04-20  8:37 [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group() Li Zefan
  2011-04-20 12:02 ` Chris Mason
@ 2011-04-20 12:22 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2011-04-20 12:22 UTC (permalink / raw)
  To: Li Zefan; +Cc: linux-btrfs@vger.kernel.org, lidongyang

Hi,

reviewed, and made sure by the means of a coccinelle script that there
are no other instances of any kmem_cache allocated data being kfreed.

dave

On Wed, Apr 20, 2011 at 04:37:39PM +0800, Li Zefan wrote:
> Since commit dc89e9824464e91fa0b06267864ceabe3186fd8b, we've changed
> to use a specific slab for alocation of free_space items.
> 
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
>  fs/btrfs/free-space-cache.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index 11d2e9c..13c29b1 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -2301,7 +2301,7 @@ int btrfs_trim_block_group(struct btrfs_block_group_cache *block_group,
>  			start = entry->offset;
>  			bytes = min(entry->bytes, end - start);
>  			unlink_free_space(block_group, entry);
> -			kfree(entry);
> +			kmem_cache_free(btrfs_free_space_cachep, entry);
>  		}
>  
>  		spin_unlock(&block_group->tree_lock);
> -- 1.7.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] 3+ messages in thread

end of thread, other threads:[~2011-04-20 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-20  8:37 [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group() Li Zefan
2011-04-20 12:02 ` Chris Mason
2011-04-20 12:22 ` David Sterba

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