From: Alex Zhuravlev Date: Wed, 3 Oct 2018 04:49:25 +0000 (+0300) Subject: LU-11406 mdt: mdt_reint_setxattr() to check rr_eadata X-Git-Tag: 2.12.0-RC1~54 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F33273%2F2;p=fs%2Flustre-release.git LU-11406 mdt: mdt_reint_setxattr() to check rr_eadata when LMV EA is requested for removal mdt_reint_setxattr() shouldn't try to access rr_eadata as it's NULL. Change-Id: Iae2b6a96ba72ae54a3151f86c0f53af9517e3aad Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/33273 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_xattr.c b/lustre/mdt/mdt_xattr.c index 4245f24..9bd7526 100644 --- a/lustre/mdt/mdt_xattr.c +++ b/lustre/mdt/mdt_xattr.c @@ -502,6 +502,10 @@ int mdt_reint_setxattr(struct mdt_thread_info *info, if (strcmp(xattr_name, XATTR_NAME_LMV) == 0) { __u32 *magic = rr->rr_eadata; + /* we don't let to remove LMV? */ + if (!rr->rr_eadata) + GOTO(out, rc = 0); + if (le32_to_cpu(*magic) == LMV_USER_MAGIC || le32_to_cpu(*magic) == LMV_USER_MAGIC_SPECIFIC) { rc = mdt_dir_layout_shrink(info);