linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Torsten Rupp <torsten.rupp@gmx.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: SegFault in cache code 2
Date: Sat, 11 Oct 2025 11:36:36 -0700	[thread overview]
Message-ID: <20251011183636.GH6188@frogsfrogsfrogs> (raw)
In-Reply-To: <12998a08-acf3-4d18-9204-ecfdc37a70e5@gmx.net>

On Sat, Oct 11, 2025 at 10:39:24AM +0200, Torsten Rupp wrote:
> Dear XFS developers,
> 
> it seems the fix for the segmentation fault in xfsprogs 6.16.0 in the
> initialization of the cache is caused by a double initialization and free of
> "xfs_extfree_item_cache" in init.c:init_caches() resp.
> init.c:destroy_caches. This is already done in xfs_alloc.c as also valgrind
> showed me.
> 
> This patch remove the double initialization and free. The segmentation fault
> disappear with this patch and valgrind is also happy:
> 
> --- xfsprogs-6.16.0.org/libxfs/init.c   2025-06-23 13:48:41.000000000 +0200
> +++ xfsprogs-6.16.0/libxfs/init.c       2025-10-11 10:17:27.101472681 +0200
> @@ -214,9 +214,6 @@
>                 fprintf(stderr, "Could not allocate btree cursor
> caches.\n");
>                 abort();
>         }
> -       xfs_extfree_item_cache = kmem_cache_init(
> -                       sizeof(struct xfs_extent_free_item),
> -                       "xfs_extfree_item");
>         xfs_trans_cache = kmem_cache_init(
>                         sizeof(struct xfs_trans), "xfs_trans");
>         xfs_parent_args_cache = kmem_cache_init(
> @@ -236,7 +233,6 @@
>         leaked += kmem_cache_destroy(xfs_da_state_cache);
>         xfs_defer_destroy_item_caches();
>         xfs_btree_destroy_cur_caches();
> -       leaked += kmem_cache_destroy(xfs_extfree_item_cache);

Oh, yeah, that is redundant.  Can you add a Signed-off-by tag so that we
can review/include this?

--D

>         leaked += kmem_cache_destroy(xfs_trans_cache);
>         leaked += kmem_cache_destroy(xfs_parent_args_cache);
> 
> Best regards, Torsten
> 
> 

      reply	other threads:[~2025-10-11 18:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11  8:39 SegFault in cache code 2 Torsten Rupp
2025-10-11 18:36 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251011183636.GH6188@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=torsten.rupp@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).