Whamcloud - gitweb
LU-10026 csdc: DoM pattern could be a combined value
authorBobi Jam <bobijam@whamcloud.com>
Thu, 17 Aug 2023 17:00:03 +0000 (01:00 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 1 Sep 2023 13:18:45 +0000 (13:18 +0000)
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 <bobijam@whamcloud.com>
Change-Id: Id0779c30c004b6979f88bf96b7b7b74a8b8c26e4
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52171
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/file.c

index 12bf18e..3ba170d 100644 (file)
@@ -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