Whamcloud - gitweb
LU-6661 dne: setdirstripe should fail if not supported 23/15123/2
authorLai Siyao <lai.siyao@intel.com>
Wed, 3 Jun 2015 13:56:56 +0000 (21:56 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 21 Jun 2015 17:40:38 +0000 (17:40 +0000)
If MDS doesn't support striped directory, creating striped directory
with 'lfs setdirstripe' should fail.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I3e1ea394d3d1055230859ff46277179f518692b3
Reviewed-on: http://review.whamcloud.com/15123
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c

index fe0d1be..adf9a72 100644 (file)
@@ -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);