From: wang di Date: Thu, 15 May 2014 09:25:14 +0000 (-0700) Subject: LU-5068 mdt: check default LMV EA when set reply EA size X-Git-Tag: 2.5.60~54 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2115c58384bd03bf4a76ba492bdf47a257cd5a3f;p=fs%2Flustre-release.git LU-5068 mdt: check default LMV EA when set reply EA size 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 Change-Id: I2f94d6e87ba05720e5e4aa694dce3246d6a27664 Reviewed-on: http://review.whamcloud.com/10338 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 8ae3794..fe0f7f6 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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; } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8741269..433c330 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 97d7fc7..7610693 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -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"); }