From: Lai Siyao Date: Thu, 28 Apr 2022 14:48:01 +0000 (-0400) Subject: LU-15832 lod: clear .do_index_ops in striping free X-Git-Tag: 2.15.51~218 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3d4ff484002bf6e29655503994c240da06f838e3;p=fs%2Flustre-release.git LU-15832 lod: clear .do_index_ops in striping free LDLM lock can guarantee LOD object directory striping is safe to access, but lod_striping_free_nolock() should clear .do_index_ops, otherwise upon some failure the directory striping is freed, while a subsequent dt_try_as_dir() skips striping initialization, and call .do_index_ops directly, which will cause crash. Signed-off-by: Lai Siyao Change-Id: Ib94a4ef2f8bf5f0d34521abff77d8be46ecbf428 Reviewed-on: https://review.whamcloud.com/47256 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Hongchao Zhang Reviewed-by: Andreas Dilger --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index ac8d0c0..504bb5f 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -9149,6 +9149,7 @@ void lod_striping_free_nolock(const struct lu_env *env, struct lod_object *lo) lo->ldo_dir_stripes_allocated = 0; lo->ldo_dir_stripe_loaded = 0; lo->ldo_dir_stripe_count = 0; + lo->ldo_obj.do_index_ops = NULL; } else if (lo->ldo_comp_entries != NULL) { for (i = 0; i < lo->ldo_comp_cnt; i++) { /* free lod_layout_component::llc_stripe array */