From a42be217b5662bc88a9f381f82482f2c5a0e8fb7 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Wed, 3 Oct 2018 07:49:25 +0300 Subject: [PATCH] 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 --- lustre/mdt/mdt_xattr.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 1.8.3.1