From: nathan Date: Thu, 18 Jun 2009 21:48:04 +0000 (+0000) Subject: b=19669 X-Git-Tag: v1_9_220~126 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b8785c155c81701a6e0d0ef397a347365e7de504;ds=sidebyside b=19669 i=nrutman i=adilger add compat/incompat flags to lma --- diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 3310fac..e648bda 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -253,10 +253,38 @@ static inline int range_is_exhausted(const struct lu_seq_range *range) * @{ */ /** + * Flags for lustre_mdt_attrs::lma_compat and lustre_mdt_attrs::lma_incompat. + */ +enum lma_compat { + LMAC_HSM = 0x00000001, + LMAC_SOM = 0x00000002, +}; + +/** + * Masks for all features that should be supported by a Lustre version to + * access a specific file. + * This information is stored in lustre_mdt_attrs::lma_incompat. + * + * NOTE: No incompat feature should be added before bug #17670 is landed. + */ +#define LMA_INCOMPAT_SUPP 0x0 + +/** * Following struct for MDT attributes, that will be kept inode's EA. * Introduced in 2.0 release (please see b15993, for details) */ struct lustre_mdt_attrs { + /** + * Bitfield for supported data in this structure. From enum lma_compat. + * lma_self_fid and lma_flags are always available. + */ + __u32 lma_compat; + /** + * Per-file incompat feature list. Lustre version should support all + * flags set in this field. The supported feature mask is available in + * LMA_INCOMPAT_SUPP. + */ + __u32 lma_incompat; /** FID of this inode */ struct lu_fid lma_self_fid; /** SOM state, mdt/ost type, others */ diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 58de195..ac8133a 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -116,8 +116,10 @@ static void mdd_device_shutdown(const struct lu_env *env, ENTRY; mdd_changelog_fini(env, m); dt_txn_callback_del(m->mdd_child, &m->mdd_txn_cb); - mdd_object_put(env, m->mdd_dot_lustre_objs.mdd_obf); - mdd_object_put(env, m->mdd_dot_lustre); + if (m->mdd_dot_lustre_objs.mdd_obf) + mdd_object_put(env, m->mdd_dot_lustre_objs.mdd_obf); + if (m->mdd_dot_lustre) + mdd_object_put(env, m->mdd_dot_lustre); if (m->mdd_obd_dev) mdd_fini_obd(env, m, cfg); orph_index_fini(env, m); diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 117547f..c584859 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -964,7 +964,7 @@ static const int osd_dto_credits_quota[DTO_NR] = { [DTO_INDEX_DELETE] = 20, /** * Unused now. - */ + */ [DTO_IDNEX_UPDATE] = 16, /* * Create a object. Same as create object in EXT3 filesystem. @@ -980,7 +980,7 @@ static const int osd_dto_credits_quota[DTO_NR] = { * INDEX_EXTRA_BLOCKS(8) + * 3(inode bits, groups, GDT) + * QUOTA(?) - */ + */ [DTO_OBJECT_DELETE] = 27, /** * Attr set credits. @@ -1772,6 +1772,15 @@ static int osd_ea_fid_get(const struct lu_env *env, struct dentry *dentry, rc = inode->i_op->getxattr(dentry, XATTR_NAME_LMA, (void *)mdt_attrs, sizeof *mdt_attrs); + /* Check LMA compatibility */ + if (rc > 0 && + (mdt_attrs->lma_incompat & ~cpu_to_be32(LMA_INCOMPAT_SUPP))) { + CWARN("Inode %lx: Unsupported incompat LMA feature(s) %#x\n", + inode->i_ino, be32_to_cpu(mdt_attrs->lma_incompat) & + ~LMA_INCOMPAT_SUPP); + return -ENOSYS; + } + if (rc > 0) { fid_be_to_cpu(fid, &mdt_attrs->lma_self_fid); rc = 0;