From: Bobi Jam Date: Wed, 24 Jan 2024 06:15:49 +0000 (+0800) Subject: LU-17464 lod: set llc_ostlist to NULL after free X-Git-Tag: 2.15.61~49 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F53797%2F2;p=fs%2Flustre-release.git 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 --- 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); }