From: Lai Siyao Date: Wed, 3 Jun 2015 13:56:56 +0000 (+0800) Subject: LU-6661 dne: setdirstripe should fail if not supported X-Git-Tag: 2.7.56~24 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=21ae299f58ea9885c71269819d72c18dd69046ac;p=fs%2Flustre-release.git LU-6661 dne: setdirstripe should fail if not supported If MDS doesn't support striped directory, creating striped directory with 'lfs setdirstripe' should fail. Signed-off-by: Lai Siyao Change-Id: I3e1ea394d3d1055230859ff46277179f518692b3 Reviewed-on: http://review.whamcloud.com/15123 Tested-by: Jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index fe0d1be..adf9a72 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -460,6 +460,10 @@ static int ll_dir_setdirstripe(struct inode *parent, struct lmv_user_md *lump, PFID(ll_inode2fid(parent)), parent, dirname, (int)lump->lum_stripe_offset, lump->lum_stripe_count); + if (lump->lum_stripe_count > 1 && + !(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_DIR_STRIPE)) + RETURN(-EINVAL); + if (lump->lum_magic != cpu_to_le32(LMV_USER_MAGIC)) lustre_swab_lmv_user_md(lump);