From 632dcf6e6ba24c9a053bbb2fd071f0c844a13460 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 24 Jan 2024 14:04:35 +0800 Subject: [PATCH] LU-17464 lod: set llc_ostlist to NULL after free Default LOV striping could free component entry llc_ostlist if needed e.g. expand component entries, without set it to NULL it could be double allocated/freed later. Lustre-change: https://review.whamcloud.com/53797 Lustre-commit: TBD (from 5e7440b488050166af15e744dc74b9dc4f0d3b96) Signed-off-by: Bobi Jam Change-Id: I25824cb61dd47ba284403039259593b88d25fa9d Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53798 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/lod/lod_lov.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 2f6d120..7ab37de 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -487,9 +487,12 @@ static void lod_free_comp_buffer(struct lod_layout_component *entries, if (entry->llc_pool != NULL) lod_set_pool(&entry->llc_pool, NULL); - if (entry->llc_ostlist.op_array) + if (entry->llc_ostlist.op_array) { OBD_FREE(entry->llc_ostlist.op_array, entry->llc_ostlist.op_size); + entry->llc_ostlist.op_array = NULL; + entry->llc_ostlist.op_size = 0; + } LASSERT(entry->llc_stripe == NULL); LASSERT(entry->llc_stripes_allocated == 0); } -- 1.8.3.1