From: Emoly Liu Date: Fri, 6 Dec 2019 02:08:07 +0000 (+0800) Subject: LU-12852 pfl: restrict the stripe count correctly X-Git-Tag: 2.12.5-RC1~35 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=454771e39c556ac5a4b290d2bbf603dc7f308fdf;p=fs%2Flustre-release.git LU-12852 pfl: restrict the stripe count correctly In function lod_get_stripe_count(), when restricting the stripe count to the maximum xattr size, the xattr overhead should be taken into count correctly. Lustre-change: https://review.whamcloud.com/36947 Lustre-commit: 6dc37759cfb22727ac5d776c38b72e8638563fd8 Signed-off-by: Emoly Liu Change-Id: Ief548e47ce4d375f2e189860ccfe05d0f3c7e890 Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/37512 Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index cf4dc7f..f5754e8 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -1784,6 +1784,8 @@ __u16 lod_get_stripe_count(struct lod_device *lod, struct lod_object *lo, max_stripes = lov_mds_md_max_stripe_count(easize, LOV_MAGIC_V3); } + max_stripes = (max_stripes == 0) ? 0 : max_stripes - 1; + return (stripe_count < max_stripes) ? stripe_count : max_stripes; }