Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7291a6d authored by Lai Siyao's avatar Lai Siyao Committed by Greg Kroah-Hartman
Browse files

staging: lustre: dne: setdirstripe should fail if not supported



If MDS doesn't support striped directory, creating striped directory
from a userland utility such as 'lfs setdirstripe' should fail.

Signed-off-by: default avatarLai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6661
Reviewed-on: http://review.whamcloud.com/15123


Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 84078adb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -419,6 +419,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);