From: tappro Date: Mon, 28 Aug 2006 12:31:05 +0000 (+0000) Subject: - decrease the seq width to prevent i_ino overflow in CMD X-Git-Tag: v1_8_0_110~486^2~1074 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=dcfb104c7b046f37976f16da761f2a221997c04c;p=fs%2Flustre-release.git - decrease the seq width to prevent i_ino overflow in CMD - put code with iget5_locked() using in ll_iget() to provide generic mapping fid to ino. It works though is disabled for now --- diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index 8fdc7a9..1c278c9 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -39,14 +39,14 @@ extern const struct lu_range LUSTRE_SEQ_SPACE_RANGE; extern const struct lu_range LUSTRE_SEQ_ZERO_RANGE; enum { - /* this is how may FIDs may be allocated in one sequence. */ - LUSTRE_SEQ_MAX_WIDTH = 0x00000000000002800ULL, + /* this is how may FIDs may be allocated in one sequence. 16384 for now */ + LUSTRE_SEQ_MAX_WIDTH = 0x0000000000004000ULL, - /* how many sequences may be allocate for meta-sequence (this is 10240 + /* how many sequences may be allocate for meta-sequence (this is 128 * sequences). */ - LUSTRE_SEQ_META_WIDTH = 0x00000000000002800ULL, + LUSTRE_SEQ_META_WIDTH = 0x0000000000000080ULL, - /* this is how many sequences (10240 * 10240) may be in one + /* this is how many sequences (128 * 128) may be in one * super-sequence allocated to MDTs. */ LUSTRE_SEQ_SUPER_WIDTH = (LUSTRE_SEQ_META_WIDTH * LUSTRE_SEQ_META_WIDTH) }; diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 10fff69..4a111b8 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -30,6 +30,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include +#include #include #include #include @@ -53,9 +54,19 @@ int ll_unlock(__u32 mode, struct lustre_handle *lockh) * Returns inode or NULL */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) +#if 0 +/* that variant provides correct mapping fid to inode, + * it is put here as alternative way to the current one ll_iget() below */ +int ll_test_inode(struct inode *inode, void *opaque) +{ + return lu_fid_eq(&ll_i2info(inode)->lli_fid, (struct lu_fid *)opaque); +} + int ll_set_inode(struct inode *inode, void *opaque) { - ll_read_inode2(inode, opaque); + struct lu_fid *fid = opaque; + ll_i2info(inode)->lli_fid = *fid; + inode->i_ino = ll_fid_build_ino(ll_s2sbi(inode->i_sb), fid); return 0; } @@ -66,6 +77,30 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, struct inode *inode; LASSERT(hash != 0); + inode = iget5_locked(sb, hash, ll_test_inode, ll_set_inode, + &md->body->fid1); + if (inode) { + if (inode->i_state & I_NEW) { + lli = ll_i2info(inode); + ll_read_inode2(inode, md); + unlock_new_inode(inode); + } else { + ll_update_inode(inode, md); + } + CDEBUG(D_VFSTRACE, "inode: %lu/%u(%p)\n", + inode->i_ino, inode->i_generation, inode); + } + + return inode; +} +#else +struct inode *ll_iget(struct super_block *sb, ino_t hash, + struct lustre_md *md) +{ + struct ll_inode_info *lli; + struct inode *inode; + LASSERT(hash != 0); + inode = iget_locked(sb, hash); if (inode) { if (inode->i_state & I_NEW) { @@ -81,6 +116,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, return inode; } +#endif #else struct inode *ll_iget(struct super_block *sb, ino_t hash, struct lustre_md *md)