Whamcloud - gitweb
LU-15899 mdt: mdt_hsm_release default lov buffer 01/55801/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 19 Jul 2024 04:07:29 +0000 (11:07 +0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 Jul 2024 15:57:05 +0000 (15:57 +0000)
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>
lustre/mdt/mdt_open.c

index 0d668a8..7ae250e 100644 (file)
@@ -2007,6 +2007,8 @@ static int mdt_hsm_release(struct mdt_thread_info *info, struct mdt_object *o,
 
        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);