Whamcloud - gitweb
LU-11406 mdt: mdt_reint_setxattr() to check rr_eadata 73/33273/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Wed, 3 Oct 2018 04:49:25 +0000 (07:49 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 13 Nov 2018 06:17:51 +0000 (06:17 +0000)
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 <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33273
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_xattr.c

index 4245f24..9bd7526 100644 (file)
@@ -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);