From c5d65539f348d266ace407e0fab997c571946804 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Fri, 18 Aug 2023 01:00:03 +0800 Subject: [PATCH] LU-10026 csdc: DoM pattern could be a combined value Contains fix from master that was missing on patch landed to b_es6_0. Fix a minor glitch for lov_getstripe_old code path (in ll_lov_getstripe_ea_info), which intends to return the last component stripe info but the commit abf04e7ea3 omits to correctly set the last component stripe info before using it. Lustre-change: https://review.whamcloud.com/51978 Lustre-commit: TBD (from dc654837688fc90320601ec12be140b413b044b2) Fixes: b0b262fe09 ("EX-7806 csdc: set DoM compression component") Fixes: abf04e7ea3 ("LU-14337 lov: return valid stripe_count/size for PFL files") Signed-off-by: Bobi Jam Change-Id: Id0779c30c004b6979f88bf96b7b7b74a8b8c26e4 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52171 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/llite/file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 12bf18e..3ba170d 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -2606,7 +2606,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, if (lmm->lmm_magic == LOV_MAGIC_COMP_V1) { struct lov_comp_md_v1 *comp_v1 = NULL; struct lov_comp_md_entry_v1 *ent; - struct lov_user_md_v1 *v1; + struct lov_user_md_v1 *v1 = NULL; __u32 off; int i = 0; @@ -2621,6 +2621,11 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, i, v1->lmm_stripe_count, v1->lmm_stripe_size); } + if (v1 == NULL) + GOTO(out, rc = -EINVAL); + + lmm->lmm_stripe_count = v1->lmm_stripe_count; + lmm->lmm_stripe_size = v1->lmm_stripe_size; /** * Return valid stripe_count and stripe_size instead of 0 for * DoM files to avoid divide-by-zero for older userspace that -- 1.8.3.1