Whamcloud - gitweb
LU-5068 mdt: check default LMV EA when set reply EA size 38/10338/2
authorwang di <di.wang@intel.com>
Thu, 15 May 2014 09:25:14 +0000 (02:25 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 28 May 2014 21:53:18 +0000 (21:53 +0000)
MDT should also check default LMV EA size when setting reply EA
size, otherwise the following xattr get will not be able to hold
default LMV EA in its reply buffer.

Add test cases to verify default stripe count.

Minor cleanup for the output of default LMV EA.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I2f94d6e87ba05720e5e4aa694dce3246d6a27664
Reviewed-on: http://review.whamcloud.com/10338
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_handler.c
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c

index 8ae3794..fe0f7f6 100644 (file)
@@ -500,6 +500,12 @@ int mdt_attr_get_eabuf_size(struct mdt_thread_info *info, struct mdt_object *o)
        if (S_ISDIR(lu_object_attr(&mdt_object_child(o)->mo_lu))) {
                rc2 = mo_xattr_get(env, mdt_object_child(o), &LU_BUF_NULL,
                                   XATTR_NAME_LMV);
+
+               if (rc2 == -ENODATA)
+                       rc2 = mo_xattr_get(env, mdt_object_child(o),
+                                          &LU_BUF_NULL,
+                                          XATTR_NAME_DEFAULT_LMV);
+
                if ((rc2 < 0 && rc2 != -ENODATA) || (rc2 > rc))
                        rc = rc2;
        }
index 8741269..433c330 100644 (file)
@@ -12840,6 +12840,10 @@ test_300g() {
        $LFS setdirstripe -D -c $MDSCOUNT -t all_char $DIR/$tdir/striped_dir ||
                error "set default stripe on striped dir error"
 
+       stripe_count=$($LFS getdirstripe -D -c $DIR/$tdir/striped_dir)
+       [ $stripe_count -eq $MDSCOUNT ] ||
+               error "default stripe wrong expect $MDSCOUNT get $stripe_count"
+
        mkdir -p $DIR/$tdir/striped_dir/{test1,test2,test3,test4}
 
        for dir in $(find $DIR/$tdir/striped_dir/*); do
index 97d7fc7..7610693 100644 (file)
@@ -2457,7 +2457,7 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
                separator = "\n";
        }
 
-       if (!(verbose & VERBOSE_OBJID))
+       if (!(verbose & VERBOSE_OBJID) || lum->lum_magic == LMV_USER_MAGIC)
                llapi_printf(LLAPI_MSG_NORMAL, "\n");
 }