diff mbox series

[3/3] xfs: free xfs_attrd_log_items correctly

Message ID 165290011952.1646163.16695840263373472236.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs: fix name/value buffer lifetime errrors | expand

Commit Message

Darrick J. Wong May 18, 2022, 6:55 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Technically speaking, objects allocated out of a specific slab cache are
supposed to be freed to that slab cache.  The popular slab backends will
take care of this for us, but SLOB famously doesn't.  Fix this, even if
slob + xfs are not that common of a combination.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_attr_item.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dave Chinner May 19, 2022, 1:37 a.m. UTC | #1
On Wed, May 18, 2022 at 11:55:19AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Technically speaking, objects allocated out of a specific slab cache are
> supposed to be freed to that slab cache.  The popular slab backends will
> take care of this for us, but SLOB famously doesn't.  Fix this, even if
> slob + xfs are not that common of a combination.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  fs/xfs/xfs_attr_item.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Allison Henderson May 19, 2022, 8:33 p.m. UTC | #2
On Wed, 2022-05-18 at 11:55 -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Technically speaking, objects allocated out of a specific slab cache
> are
> supposed to be freed to that slab cache.  The popular slab backends
> will
> take care of this for us, but SLOB famously doesn't.  Fix this, even
> if
> slob + xfs are not that common of a combination.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Looks fine:
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>  fs/xfs/xfs_attr_item.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
> index 7d4469e8a4fc..9ef2c2455921 100644
> --- a/fs/xfs/xfs_attr_item.c
> +++ b/fs/xfs/xfs_attr_item.c
> @@ -290,7 +290,7 @@ STATIC void
>  xfs_attrd_item_free(struct xfs_attrd_log_item *attrdp)
>  {
>  	kmem_free(attrdp->attrd_item.li_lv_shadow);
> -	kmem_free(attrdp);
> +	kmem_cache_free(xfs_attrd_cache, attrdp);
>  }
>  
>  STATIC void
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index 7d4469e8a4fc..9ef2c2455921 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -290,7 +290,7 @@  STATIC void
 xfs_attrd_item_free(struct xfs_attrd_log_item *attrdp)
 {
 	kmem_free(attrdp->attrd_item.li_lv_shadow);
-	kmem_free(attrdp);
+	kmem_cache_free(xfs_attrd_cache, attrdp);
 }
 
 STATIC void