From f2d85ea336d74791cab7451677710658267f3804 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 22 Aug 2008 17:40:24 +0000 Subject: [PATCH] b=15899 i=nathan i=adilger add OST pools --- lustre/liblustre/super.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 9abe98d..7c20e5a 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -1611,11 +1611,25 @@ static int llu_lov_dir_setstripe(struct inode *ino, unsigned long arg) if (rc) return(-EFAULT); - if (lum.lmm_magic != LOV_USER_MAGIC) + switch (lum.lmm_magic) { + case LOV_USER_MAGIC_V1: { + if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC_V1)) + lustre_swab_lov_user_md_v1(&lum); + break; + } + case LOV_USER_MAGIC_V3: { + if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC_V3)) + lustre_swab_lov_user_md_v3((struct lov_user_md_v3 *)&lum); + break; + } + default: { + CDEBUG(D_IOCTL, "bad userland LOV MAGIC:" + " %#08x != %#08x nor %#08x\n", + lum.lmm_magic, LOV_USER_MAGIC_V1, + LOV_USER_MAGIC_V3); RETURN(-EINVAL); - - if (lum.lmm_magic != cpu_to_le32(LOV_USER_MAGIC)) - lustre_swab_lov_user_md(&lum); + } + } /* swabbing is done in lov_setstripe() on server side */ rc = mdc_setattr(sbi->ll_mdc_exp, &op_data, -- 1.8.3.1