Message ID | 1545064202-22483-20-git-send-email-jsimmons@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | lustre: PFL port to linux client | expand |
diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index d1693e3..deb0f0e 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -1036,6 +1036,9 @@ struct lov_mds_md_v3 { /* LOV EA mds/wire data (little-endian) */ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic) { + if (stripes == (__u16)-1) + stripes = 0; + if (lmm_magic == LOV_MAGIC_V3) return sizeof(struct lov_mds_md_v3) + stripes * sizeof(struct lov_ost_data_v1); diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index 8e6d67b..b19adef 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -457,6 +457,9 @@ struct lov_comp_md_v1 { static inline __u32 lov_user_md_size(__u16 stripes, __u32 lmm_magic) { + if (stripes == (__u16)-1) + stripes = 0; + if (lmm_magic == LOV_USER_MAGIC_V1) return sizeof(struct lov_user_md_v1) + stripes * sizeof(struct lov_user_ost_data_v1);