From e2b7a2cb03ede26fc9626af5302371e116283e6e Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 24 Jan 2024 14:15:49 +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. Signed-off-by: Bobi Jam Change-Id: I25824cb61dd47ba284403039259593b88d25fa9d Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53797 Reviewed-by: Andreas Dilger Reviewed-by: Qian Yingjin Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- 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 d7000b6..9f59dd3 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -485,9 +485,12 @@ static void lod_free_comp_buffer(struct lod_layout_component *entries, continue; 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