If LOV is not set during mdt_hsm_release the md_attr needs
to be assigned a large enough buffer to define lov default
values.
Since the md_attr is possibly not populated at this point
use the common mti_xattr_buf to hold the values.
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I3e1c2f751bb031fdf3ea0d8583213cd5c81a57d7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55801
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (!(ma->ma_valid & MA_LOV)) {
/* Even empty file are released */
+ ma->ma_lmm = (void *)info->mti_xattr_buf;
+ LASSERT(sizeof(*ma->ma_lmm) < sizeof(info->mti_xattr_buf));
memset(ma->ma_lmm, 0, sizeof(*ma->ma_lmm));
ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V1_DEFINED);
ma->ma_lmm->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);